]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: k3: Use devm_clk_get_enabled() helper
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Wed, 24 Aug 2022 08:25:11 +0000 (10:25 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 12 Oct 2022 22:31:57 +0000 (00:31 +0200)
commit724a403d6b1ca9ef0bce46ca78262b740a005df1
tree8fb17de483bd3314868f3d2b6e1b93d9268ffbcb
parent6f89b8ef4c0ae25ce5a5d6c5f862ba951de09efa
rtc: k3: 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
   12843    4804      64   17711    452f drivers/rtc/rtc-ti-k3.o
down to:
   12523    4804      64   17391    43ef drivers/rtc/rtc-ti-k3.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/601288834ab71c0fddde7eedd8cdb8001254ed7e.1661329498.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-ti-k3.c