[PATCH 4/7] iio: dac: ad5755: Use devm_mutex_init()

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

drivers/iio/dac/ad5755.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/dac/ad5755.c b/drivers/iio/dac/ad5755.c
index d0e5f35462b1..cc6d56140d66 100644
--- a/drivers/iio/dac/ad5755.c
+++ b/drivers/iio/dac/ad5755.c
@@ -827,8 +827,9 @@ static int ad5755_probe(struct spi_device *spi)
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->num_channels = AD5755_NUM_CHANNELS;

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

pdata = ad5755_parse_fw(&spi->dev);
if (!pdata) {
--
2.53.0