]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: mxc: Use devm_clk_get_enabled() helper
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 15 Aug 2022 16:59:23 +0000 (18:59 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 23 Aug 2022 20:33:38 +0000 (22:33 +0200)
commit5a57693c6d8022041e7ff04abfdc5cfdeb26169c
treecd2ee87864c234435cd9e1d1e58e2e7db555e1d8
parent61f7390fc9741ff13c15f162deac7b3694770829
rtc: mxc: Use devm_clk_get_enabled() helper

The devm_clk_get_enabled() helper:
   - calls devm_clk_get()
   - calls clk_prepare_enable() and registers what is needed in order to
     call clk_disable_unprepare() when needed, as a managed resource.

This simplifies the code, the error handling paths and avoid the need of
a dedicated function used with devm_add_action_or_reset().

Based on my test with allyesconfig, this reduces the .o size from:
   text    data     bss     dec     hex filename
   6705    1968       0    8673    21e1 drivers/rtc/rtc-mxc.o
down to:
   6212    1968       0    8180    1ff4 drivers/rtc/rtc-mxc.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/1b5ad1877304b01ddbba73ca615274a52f781aa2.1660582728.git.christophe.jaillet@wanadoo.fr
drivers/rtc/rtc-mxc.c