[PATCH 2/7] iio: dac: ad7303: Use devm_mutex_init()

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

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

diff --git a/drivers/iio/dac/ad7303.c b/drivers/iio/dac/ad7303.c
index a88cc639047d..1c2960fa9743 100644
--- a/drivers/iio/dac/ad7303.c
+++ b/drivers/iio/dac/ad7303.c
@@ -218,7 +218,9 @@ static int ad7303_probe(struct spi_device *spi)

st->spi = spi;

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

st->vdd_reg = devm_regulator_get(&spi->dev, "Vdd");
if (IS_ERR(st->vdd_reg))
--
2.53.0