[PATCH] fpga: xilinx-pr-decoupler: Use devm_clk_get_prepared()
Xu Yilun
yilun.xu at linux.intel.com
Fri Jun 26 10:22:53 PDT 2026
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 <michal.simek at amd.com>
>
> Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey at amd.com>
Reviewed-by: Xu Yilun <yilun.xu at intel.com>
Will apply to for-next when 7.2-rc1 comes.
More information about the linux-arm-kernel
mailing list