diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2022-08-24 11:42:29 +0300 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2022-10-13 01:31:37 +0300 |
commit | 94e4603d1a262f8d79f6186d0df0379243613b95 (patch) | |
tree | 0bf84e2051156a231e7150fc903bfb5ab66c54db /drivers/rtc/rtc-twl.c | |
parent | 24fb316155a5f6ba278a8b110c60e67b79900356 (diff) | |
download | linux-94e4603d1a262f8d79f6186d0df0379243613b95.tar.xz |
rtc: jz4740: 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().
As a side effect, some error messages are not logged anymore, so also use
dev_err_probe() instead of dev_err() in case of error.
At least the error code will be logged (and -EPROBE_DEFER will be filtered)
Based on my test with allyesconfig, this reduces the .o size from:
text data bss dec hex filename
9025 2488 128 11641 2d79 drivers/rtc/rtc-jz4740.o
down to:
8267 2080 128 10475 28eb drivers/rtc/rtc-jz4740.o
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/af10570000d7e103d70bbea590ce8df4f8902b67.1661330532.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-twl.c')
0 files changed, 0 insertions, 0 deletions