Re: [PATCH v4 4/4] iio: adc: ti-ads7950: complete conversion to using managed resources
From: Dmitry Torokhov
Date: Mon Mar 30 2026 - 05:32:56 EST
On March 30, 2026 2:20:33 AM PDT, Bartosz Golaszewski <brgl@xxxxxxxxxx> wrote:
>On Mon, 30 Mar 2026 00:47:09 +0200, Dmitry Torokhov
><dmitry.torokhov@xxxxxxxxx> said:
>> All resources that the driver needs have managed API now. Switch to
>> using them to make code clearer and drop ti_ads7950_remove().
>>
>> Reviewed-by: David Lechner <dlechner@xxxxxxxxxxxx>
>> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
>> ---
>> -
>
>[snip]
>
>> -static void ti_ads7950_remove(struct spi_device *spi)
>> -{
>> - struct iio_dev *indio_dev = spi_get_drvdata(spi);
>> - struct ti_ads7950_state *st = iio_priv(indio_dev);
>> -
>> - gpiochip_remove(&st->chip);
>> - iio_device_unregister(indio_dev);
>> - iio_triggered_buffer_cleanup(indio_dev);
>> - mutex_destroy(&st->slock);
>
>That's a functional change, there's no corresponding conversion to using
>devm_mutex_init().
devm_mutex_init() makes absolutely no sense, as well as having mutex_destroy() in remove(). The memory containing the mutex will be released right after.
--
Dmitry