Re: [PATCH] phy: amlogic: meson-axg-mipi-dphy: fix clock leak in probe error paths

From: Manivannan Sadhasivam

Date: Fri Nov 27 2026 - 10:37:08 EST


On 2026-11-18 09:37 +0800, Xiangwu Lai wrote:
> The probe path enables the pclk clock with clk_prepare_enable() but
> none of the error paths that follow (reset_control_deassert(),
> devm_phy_create(), devm_of_phy_provider_register()) disable it again.
> When one of them fails, the prepared and enabled clock is leaked.
>
> Use devm_clk_get_enabled() to get the clock, so the clock is disabled
> and its reference released automatically if probe fails after it or
> the driver detaches.
>
> Fixes: 76aefb221146 ("phy: amlogic: Add AXG MIPI D-PHY driver")
> Signed-off-by: Xiangwu Lai <laixiangwu@xxxxxxxxxxxxxxxxxxxx>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxxxxxxxx>

- Mani