]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iio: adc: ad4062: use dev_err_probe()
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Mon, 30 Mar 2026 11:18:56 +0000 (14:18 +0300)
committerJonathan Cameron <jic23@kernel.org>
Mon, 27 Apr 2026 08:58:18 +0000 (09:58 +0100)
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>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad4062.c

index 222499a45b9b4af723eedf7375297e6e33799af9..8e5984055b159eadced7069d257bf9c1f91abf9a 100644 (file)
@@ -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;
 }