diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-03-02 10:12:51 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-09 17:31:53 +0100 |
commit | 9263271a61fcb07b8a30379e785391415d10aa72 (patch) | |
tree | ad5a651e499ccb62dd58c73e086a162589a74c9a /init/do_mounts.h | |
parent | 7ef1a2c1c9dffa177ecc3ea50b7f5ee63a621137 (diff) | |
download | linux-stable-9263271a61fcb07b8a30379e785391415d10aa72.tar.gz linux-stable-9263271a61fcb07b8a30379e785391415d10aa72.tar.bz2 linux-stable-9263271a61fcb07b8a30379e785391415d10aa72.zip |
misc: sram: Improve and simplify clk handling
The current code tries to get an associated clk, ignores any errors in the
process and if there is a clock enables it unconditionally for the whole
lifetime of the sram device.
Instead use an "optional" variant of devm_clk_get() which handles the case
where no clk is needed for the sram device and do proper error handling
for the remaining error cases. Also use an "enabled" variant of
devm_clk_get() to simplify. With that .probe() is the only function using
struct sram_dev::clk, so it can be replaced by a local variable.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://lore.kernel.org/r/20230302091251.1852454-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'init/do_mounts.h')
0 files changed, 0 insertions, 0 deletions