Use dev_err_probe() instead of dev_err() in the probe path to ensure
proper handling of deferred probing and to simplify error handling.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
drivers/iio/adc/ad4062.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/ad4062.c b/drivers/iio/adc/ad4062.c
index c864de3b46ba..8942c79e8d83 100644
--- a/drivers/iio/adc/ad4062.c
+++ b/drivers/iio/adc/ad4062.c
@@ -436,10 +436,9 @@ static int ad4062_check_ids(struct ad4062_state *st)
return ret;
val = be16_to_cpu(st->buf.be16);
- if (val != AD4062_I3C_VENDOR) {
- dev_err(dev, "Vendor ID x%x does not match expected value\n", val);
- return -ENODEV;
- }
+ if (val != AD4062_I3C_VENDOR)
+ return dev_err_probe(dev, -ENODEV,
+ "Vendor ID x%x does not match expected value\n", val);
return 0;
}
--
2.43.0