Re: [PATCH] fpga: xilinx-pr-decoupler: Use devm_clk_get_prepared()

Xu Yilun <[email protected]> Sat, 27 Jun 2026 01:22:53 +0800
Newsgroups org.kernel.vger.linux-fpga,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel
Message-ID <aj61bRnqxDEDx9en@yilunxu-OptiPlex-7050>
On Tue, Jun 23, 2026 at 04:31:28PM +0530, Pandey, Radhey Shyam wrote:
> > The driver keeps the "aclk" clock prepared but disabled in its idle
> > state, toggling only the atomic clk_enable()/clk_disable() around
> > register accesses in the bridge enable_set/enable_show callbacks.
> > 
> > At probe time this was open-coded as clk_prepare_enable() immediately
> > followed by clk_disable(), leaving the clock prepared, with a matching
> > clk_unprepare() in the error path and in remove().
> > 
> > devm_clk_get_prepared() expresses exactly this: it gets and prepares the
> > clock and unprepares it automatically on driver detach.
> > 
> > Use it to drop the manual prepare/disable dance, the error-path
> > unprepare, and the now-empty clock teardown in remove().
> > 
> > Signed-off-by: Michal Simek <[email protected]>
> 
> Reviewed-by: Radhey Shyam Pandey <[email protected]>

Reviewed-by: Xu Yilun <[email protected]>

Will apply to for-next when 7.2-rc1 comes.