]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: dac: ad5686: Use devm_mutex_init()
authorDavid Carlier <devnexen@gmail.com>
Fri, 10 Apr 2026 19:37:35 +0000 (20:37 +0100)
committerJonathan Cameron <jic23@kernel.org>
Mon, 27 Apr 2026 08:58:22 +0000 (09:58 +0100)
Use devm_mutex_init() which is helpful with CONFIG_DEBUG_MUTEXES.

Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/dac/ad5686.c

index 4b18498aa0749e3ef44125ff8f73bb5b9fbb898b..9a384c50929bcca45e1007723d427650cecccf46 100644 (file)
@@ -494,7 +494,9 @@ int ad5686_probe(struct device *dev,
        indio_dev->channels = st->chip_info->channels;
        indio_dev->num_channels = st->chip_info->num_channels;
 
-       mutex_init(&st->lock);
+       ret = devm_mutex_init(dev, &st->lock);
+       if (ret)
+               return ret;
 
        switch (st->chip_info->regmap_type) {
        case AD5310_REGMAP: