[PATCH 3/7] iio: dac: ad5758: Use devm_mutex_init()

David Carlier
2026-04-10T19:37:47Z

drivers/iio/dac/ad5758.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/dac/ad5758.c b/drivers/iio/dac/ad5758.c
index 4ed4fda76ea9..8e6fb46cce4d 100644
--- a/drivers/iio/dac/ad5758.c
+++ b/drivers/iio/dac/ad5758.c
@@ -851,7 +851,9 @@ static int ad5758_probe(struct spi_device *spi)

st->spi = spi;

- mutex_init(&st->lock);
+ ret = devm_mutex_init(&spi->dev, &st->lock);
+ if (ret)
+ return ret;

indio_dev->name = spi_get_device_id(spi)->name;
indio_dev->info = &ad5758_info;
--
2.53.0