Re: [PATCH v2] net: macb: check return value of clk_prepare_enable() in runtime resume
From: Andrew Lunn
Date: Mon Jun 01 2026 - 10:14:23 EST
On Mon, Jun 01, 2026 at 06:19:22AM +0000, Gustavo Kenji Mendonça Kaneko wrote:
> macb_runtime_resume() calls clk_prepare_enable() five times but discards
> the return value each time. clk_prepare_enable() is marked __must_check,
> and if a clock fails to enable the driver would silently continue with
> potentially unclocked hardware.
>
> The symmetric disable path, macb_clks_disable(), already uses
> clk_bulk_disable_unprepare(). Convert the enable path to the matching
> clk_bulk_prepare_enable(), which enables the clocks as a group and, on
> failure, unwinds the ones it already enabled before returning the error.
Given that the device is missing clocks either way, it is dead. What
is the benefit of returning the error code? It would be good to add
that to the commit message, as a justification for the
change. Otherwise this just seems like pointless churn.
Andrew