From: Antoniu Miclaus Date: Fri, 27 Feb 2026 14:01:39 +0000 (+0200) Subject: iio: dac: ad7293: use dev_err_probe() X-Git-Tag: v7.1-rc1~17^2~120^2~146 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=bbb8e1206716b6d4c46c931d741140098618f8fb;p=thirdparty%2Fkernel%2Flinux.git iio: dac: ad7293: use dev_err_probe() Use dev_err_probe() consistently in the probe path to simplify error handling and ensure deferred probes are logged correctly. Signed-off-by: Antoniu Miclaus Reviewed-by: Andy Shevchenko Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/dac/ad7293.c b/drivers/iio/dac/ad7293.c index c86c54d53df1c..df6f126abf05c 100644 --- a/drivers/iio/dac/ad7293.c +++ b/drivers/iio/dac/ad7293.c @@ -806,7 +806,7 @@ static int ad7293_init(struct ad7293_state *st) { int ret; u16 chip_id; - struct spi_device *spi = st->spi; + struct device *dev = &st->spi->dev; ret = ad7293_properties_parse(st); if (ret) @@ -821,10 +821,8 @@ static int ad7293_init(struct ad7293_state *st) if (ret) return ret; - if (chip_id != AD7293_CHIP_ID) { - dev_err(&spi->dev, "Invalid Chip ID.\n"); - return -EINVAL; - } + if (chip_id != AD7293_CHIP_ID) + return dev_err_probe(dev, -EINVAL, "Invalid Chip ID.\n"); if (!st->vrefin_en) return __ad7293_spi_update_bits(st, AD7293_REG_GENERAL,