Re: [PATCH v6 5/7] iio: ssp_sensors: convert probe and teardown to devm-managed resources
From: Sanjay Chitroda
Date: Sun Apr 19 2026 - 08:33:55 EST
On 15 April 2026 3:03:17 pm IST, Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
>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).
>
Agree, will cross confirm and rectify in next series.
> 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.
>