Re: [PATCH] net: stmmac: dwmac-meson8b: fix meson8b_devm_clk_prepare_enable()

From: Martin Blumenstingl
Date: Sat Nov 05 2022 - 18:56:16 EST


Rasmus replied to me off-list yesterday. His reply is important so I
am sharing it here.

On Fri, Nov 4, 2022 at 10:02 PM Martin Blumenstingl
<martin.blumenstingl@xxxxxxxxxxxxxx> wrote:
[...]
> If we want to propagate the error code returned by
> devm_add_action_or_reset() then we also need to do the clean up within
> meson8b_devm_clk_prepare_enable(), meaning we need to call
> clk_disable_unprepare() in case devm_add_action_or_reset() failed.
> Your change just propagates the error code without disabling and
> unpreparing the clock.
Rasmus replied to me:
"devm_add_action_or_reset precisely calls the reset callback for you
if the add action falls..."

I was not aware of this but it's actually true, which makes the patch
perfectly valid. Thanks for the heads up Rasmus!

So this patch gets my:
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@xxxxxxxxxxxxxx>

I suggest applying it to net-next (even though it carries a Fixes tag)
so the various kernel auto testing labs can try it out on as many
Amlogic SoCs as possible.


Best regards,
Martin