Re: [PATCH] misc: sram: Improve and simplify clk handling

From: Philipp Zabel
Date: Mon Mar 06 2023 - 07:01:47 EST


On Thu, Mar 02, 2023 at 10:12:51AM +0100, Uwe Kleine-König wrote:
> 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@xxxxxxxxxxxxxx>

Reviewed-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>

regards
Philipp