]> git.baikalelectronics.ru Git - kernel.git/commitdiff
iio: magnetometer: ak8974: Silence deferred-probe error
authorDmitry Osipenko <digetx@gmail.com>
Sat, 18 Apr 2020 17:12:44 +0000 (20:12 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 19 Apr 2020 15:56:43 +0000 (16:56 +0100)
It's not uncommon that voltage regulator becomes available later during
kernel's boot process. This patch adds info message about unavailable
regulators in a case of the deferred-probe error and also amends the
error message with a error code.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/magnetometer/ak8974.c

index fc7e910f8e8bfd1c7bf63664d20a6e7133e847f5..d6d5087275efa9635f6d63cf3971b9e9f4605633 100644 (file)
@@ -746,7 +746,12 @@ static int ak8974_probe(struct i2c_client *i2c,
                                      ARRAY_SIZE(ak8974->regs),
                                      ak8974->regs);
        if (ret < 0) {
-               dev_err(&i2c->dev, "cannot get regulators\n");
+               if (ret != -EPROBE_DEFER)
+                       dev_err(&i2c->dev, "cannot get regulators: %d\n", ret);
+               else
+                       dev_dbg(&i2c->dev,
+                               "regulators unavailable, deferring probe\n");
+
                return ret;
        }