]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iio: dac: ad5446: Make use of devm_mutex_init()
authorNuno Sá <nuno.sa@analog.com>
Tue, 4 Nov 2025 15:35:13 +0000 (15:35 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 9 Nov 2025 16:16:29 +0000 (16:16 +0000)
Use devm_mutex_init() which is helpful with CONFIG_DEBUG_MUTEXES.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/ad5446.c

index c7876217c7ecf938a287df8d3c4f5976bb2ebee9..59e1f67ef3342ee4f481187f94127751a093a7eb 100644 (file)
@@ -184,7 +184,9 @@ int ad5446_probe(struct device *dev, const char *name,
        indio_dev->channels = &st->chip_info->channel;
        indio_dev->num_channels = 1;
 
-       mutex_init(&st->lock);
+       ret = devm_mutex_init(dev, &st->lock);
+       if (ret)
+               return ret;
 
        st->pwr_down_mode = MODE_PWRDWN_1k;