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 /drivers/misc/sram.h | |
parent | 7ef1a2c1c9dffa177ecc3ea50b7f5ee63a621137 (diff) |
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 'drivers/misc/sram.h')
-rw-r--r-- | drivers/misc/sram.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/misc/sram.h b/drivers/misc/sram.h index d2058d8c8f1d..397205b8bf6f 100644 --- a/drivers/misc/sram.h +++ b/drivers/misc/sram.h @@ -27,7 +27,6 @@ struct sram_dev { bool no_memory_wc; struct gen_pool *pool; - struct clk *clk; struct sram_partition *partition; u32 partitions; |