diff options
author | Christophe JAILLET | 2022-08-24 10:18:25 +0200 |
---|---|---|
committer | Alexandre Belloni | 2022-10-13 00:31:18 +0200 |
commit | 24fb316155a5f6ba278a8b110c60e67b79900356 (patch) | |
tree | 8c3df0c5aa00ef4b39c6d9b3575d84eb31c044fa /Documentation/spi | |
parent | d73d66c0e05741b35b7398e647b8c4f2aaea9b09 (diff) |
rtc: mpfs: 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().
That said, mpfs_rtc_init_clk() is the same as devm_clk_get_enabled(), so
use this function directly instead.
This also fixes an (unlikely) unchecked devm_add_action_or_reset() error.
Based on my test with allyesconfig, this reduces the .o size from:
text data bss dec hex filename
5330 2208 0 7538 1d72 drivers/rtc/rtc-mpfs.o
down to:
5074 2208 0 7282 1c72 drivers/rtc/rtc-mpfs.o
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/e55c959f2821a2c367a4c5de529a638b1cc6b8cd.1661329086.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'Documentation/spi')
0 files changed, 0 insertions, 0 deletions