[PATCH v2 10/12] iio: dac: ad7293: use dev_err_probe in probe path

From: Antoniu Miclaus

Date: Mon Feb 23 2026 - 08:17:16 EST


Replace dev_err() + return with dev_err_probe() in the probe path
to simplify error handling and to ensure the error code is logged.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@xxxxxxxxxx>
---
drivers/iio/dac/ad7293.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/dac/ad7293.c b/drivers/iio/dac/ad7293.c
index 0168d111ecbc..e26cc36e9270 100644
--- a/drivers/iio/dac/ad7293.c
+++ b/drivers/iio/dac/ad7293.c
@@ -821,10 +821,9 @@ static int ad7293_init(struct ad7293_state *st)
if (ret)
return ret;

- if (chip_id != AD7293_CHIP_ID) {
- dev_err(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,
--
2.43.0