Re: [PATCH v2] clk: mediatek: mt6735: Unregister PLLs on probe failure

From: Brian Masney

Date: Mon Jul 06 2026 - 16:41:30 EST


On Wed, Jun 24, 2026 at 03:23:55PM +0900, Myeonghun Pak wrote:
> mtk_clk_register_plls() registers the apmixedsys PLL clocks manually, while
> clk_mt6735_apmixed_remove() unregisters them on driver removal.
>
> If devm_of_clk_add_hw_provider() fails after the PLL registration succeeds,
> probe returns the error directly and the remove callback is not run. This
> leaves the registered PLL clocks behind on the probe failure path.
>
> Unregister the PLLs in that failure branch before returning the error.
>
> Fixes: 43c04ed79189 ("clk: mediatek: Add drivers for MediaTek MT6735 main clock and reset drivers")
> Co-developed-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Myeonghun Pak <mhun512@xxxxxxxxx>

Reviewed-by: Brian Masney <bmasney@xxxxxxxxxx>