Skip to contentSkip to conversation

iio: magnetometer: ak8974: Silence deferred-probe error

PATCH In review Dmitry Osipenko 2 participants 3 messages Apr 18, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 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.

---

Changelog:

v3: - Replaced dev_info() with dev_dbg().

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(-)
drivers/iio/magnetometer/ak8974.c +6 -1
index d32996702110..372c80c25dd4 100644
@@ -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;
 	}
 
Signature · 1 line
2.26.0
maintainer
#1 lore raw
Quoted 6 lines · On Sat, 18 Apr 2020 20:12:44 +0300 Dmitry Osipenko <[email protected]> wrote:

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.

Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.

Thanks,

Jonathan

Quoted 30 lines

---

Changelog:

v3: - Replaced dev_info() with dev_dbg().

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(-)
drivers/iio/magnetometer/ak8974.c +6 -1
index d32996702110..372c80c25dd4 100644
@@ -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;
 	}
 
#2 lore raw

18.04.2020 21:21, Jonathan Cameron пишет:

Quoted 8 lines
Quoted 5 lines · On Sat, 18 Apr 2020 20:12:44 +0300 Dmitry Osipenko <[email protected]> wrote:

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.

Quoted 4 lines
Quoted 1 line

Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.

Awesome, thank you :)