[PATCH v2] thermal/drivers/sun8i: Fix some error handling paths in sun8i_ths_probe()

Maxime Ripard maxime at cerno.tech
Mon May 15 04:54:41 PDT 2023


Hi,

On Sun, May 14, 2023 at 08:46:05PM +0200, Christophe JAILLET wrote:
> Should an error occur after calling sun8i_ths_resource_init() in the probe
> function, some resources need to be released, as already done in the
> .remove() function.
> 
> Switch to the devm_clk_get_enabled() helper and add a new devm_action to
> turn sun8i_ths_resource_init() into a fully managed function.
> 
> Move the place where reset_control_deassert() is called so that the
> recommended order of reset release/clock enable steps is kept.
> A64 manual states that:
> 
> 	3.3.6.4. Gating and reset
> 
> 	Make sure that the reset signal has been released before the release of
> 	module clock gating;
> 
> This fixes the issue and removes some LoC at the same time.

It should really be three different patches:
 - One to fix the resource release, that can be backported to stable
   releases
 - One to switch to devm_clk_get_enabled
 - and one to change the order of clock enable vs reset deassertion

Maxime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20230515/544abd17/attachment.sig>


More information about the linux-arm-kernel mailing list