aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2020-04-18 20:12:44 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-04-19 16:56:43 +0100
commit2de8c02349f02d014e51b43f306d28fc7a23ea6e (patch)
treee30fc4956da3675166cc252d6a8441c0b97f4c9f /drivers/iio
parentDocumentation: ABI: document IIO in_proximity_nearlevel file (diff)
downloadlinux-dev-2de8c02349f02d014e51b43f306d28fc7a23ea6e.tar.xz
linux-dev-2de8c02349f02d014e51b43f306d28fc7a23ea6e.zip
iio: magnetometer: ak8974: Silence deferred-probe error
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>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/magnetometer/ak8974.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c
index fc7e910f8e8b..d6d5087275ef 100644
--- a/drivers/iio/magnetometer/ak8974.c
+++ b/drivers/iio/magnetometer/ak8974.c
@@ -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;
}