Re: [PATCH v2 3/5] iio: adc: bcm_iproc_adc: use devm-managed cleanup

From: Jonathan Cameron

Date: Sun Aug 30 2026 - 16:19:09 EST


> Use devm_clk_get_enabled() to manage the ADC clock and
> devm_add_action_or_reset() to manage ADC cleanup.
>
> Since the clock is only needed during probe, keep it as a local
> variable instead of storing it in struct iproc_adc_priv.
>

Given this section needed discussion...

> Register the ADC cleanup action immediately after enabling the ADC
> so that it is automatically performed on probe failure and device
> removal.

I would have left this for a follow up patch rather than
doing it in this one. Here it is not really the number of changes but
rather focusing the reasoning on one thing. Even without that
splitting the two changes would have been fine.

>
> This removes the manual clock cleanup callback and simplifies the
> probe error paths.
>
> Signed-off-by: Mohammad Shahid <mdshahid03@xxxxxxxxx>

Otherwise LGTM. Note this is a minor thing so if nothing else
comes up after we've let this sit for a few days on the list
I'll probably apply it as it stands anyway.

Thanks,

Jonathan

--
Jonathan Cameron <jonathan.cameron@xxxxxxxxxxxxxxxx>