Re: [PATCH v3 1/2] clk: palmas: Manage external-control prepare with devm
From: Brian Masney
Date: Thu Jul 16 2026 - 13:40:11 EST
On Sat, Jul 11, 2026 at 11:17:42PM +0900, Myeonghun Pak wrote:
> palmas_clks_init_configure() prepares the clock when an external control
> pin is configured. The current driver only drops that prepare reference
> when external control configuration fails.
>
> If provider registration fails after that point, or if the driver is later
> removed, the prepare reference remains held.
>
> Register a device-managed action after clk_prepare() succeeds. This
> balances the prepare reference on subsequent probe failure and driver
> removal.
>
> Fixes: 942d1d674931 ("clk: Add driver for Palmas clk32kg and clk32kgaudio clocks")
> 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>
I checked the other clk drivers and I don't see where any other drivers
call clk_unprepare() from a devm action, so I think this is fine in the
driver. If another driver needs this as well at some point, then it can
be split out into a common helper.
This is the first driver I've noticed with the external pin control.