Re: [PATCH v6 5/7] iio: ssp_sensors: convert probe and teardown to devm-managed resources

From: Andy Shevchenko

Date: Wed Apr 15 2026 - 05:33:37 EST


On Wed, Apr 15, 2026 at 10:37:47AM +0530, Sanjay Chitroda wrote:

> Convert SSP driver resource management to use devm-managed helpers
> and devm actions, tying the lifetime of all resources to the device.
>
> Mutex initialization, IRQ registration, work items, timers, and MFD
> resource are now managed using devm APIs. Cleanup logic previously
> handled explicitly in probe error paths and the remove callback is
> replaced with devm_add_action_or_reset(), ensuring correct teardown
> ordering and consistent behaviour on probe failure and device unbind.
>
> This simplifies the probe path by removing goto-based error handling,
> eliminates the remove callback entirely.
>
> No functional change intended.

...

> + ret = devm_add_action_or_reset(&spi->dev,
> + ssp_disable_wdt_timer, data);

It's perfectly a single line of 79 characters (we allow 80 in strict mode and
100 in relaxed and you seems stick with the former, which is fine).

ret = devm_add_action_or_reset(&spi->dev, ssp_disable_wdt_timer, data);

...

> + ret = devm_add_action_or_reset(&spi->dev,
> + ssp_shutdown_action, data);

Ditto.

--
With Best Regards,
Andy Shevchenko