[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200417162204.14463-1-digetx@gmail.com>
Date: Fri, 17 Apr 2020 19:22:04 +0300
From: Dmitry Osipenko <digetx@...il.com>
To: Linus Walleij <linus.walleij@...aro.org>,
Jonathan Cameron <jic23@...nel.org>,
Hartmut Knaack <knaack.h@....de>,
Lars-Peter Clausen <lars@...afoo.de>,
Peter Meerwald-Stadler <pmeerw@...erw.net>
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2] 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@...il.com>
---
Changelog:
v2: - Replaced dev_printk() with dev_info() for the deferred-probe error,
as was requested by Linus Walleij in a review comment to v1.
drivers/iio/magnetometer/ak8974.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c
index d32996702110..ae1dc478fc02 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_info(&i2c->dev,
+ "regulators unavailable, deferring probe\n");
+ else
+ dev_err(&i2c->dev, "cannot get regulators: %d\n", ret);
+
return ret;
}
--
2.26.0
Powered by blists - more mailing lists