Skip to contentSkip to conversation

drivers: iio: mpu3050: use dev_err_probe for regulator request

PATCH In review Svyatoslav Ryhel 3 participants 4 messages Jan 22

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

cover drivers: iio: mpu3050: use dev_err_probe for regulator request

Regulator requesting may result in deferred probing error which will abort driver probing. To avoid this just use dev_err_probe which handles deferred probing.

Addresses this situation:

[    2.250875] mpu3050-i2c 2-0068: Cannot get regulators

Svyatoslav Ryhel (1):
drivers: iio: mpu3050: use dev_err_probe for regulator request

 drivers/iio/gyro/mpu3050-core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Signature · 1 line
2.51.0
#1 lore raw

PATCH 1/1 drivers: iio: mpu3050: use dev_err_probe for regulator request

Regulator requesting may result in deferred probing error which will abort driver probing. To avoid this just use dev_err_probe which handles deferred probing.

---
 drivers/iio/gyro/mpu3050-core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/iio/gyro/mpu3050-core.c +2 -4
index 67ae7d1012bc..ee2fcd20545d 100644
@@ -1162,10 +1162,8 @@ int mpu3050_common_probe(struct device *dev,
 	mpu3050->regs[1].supply = mpu3050_reg_vlogic;
 	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(mpu3050->regs),
 				      mpu3050->regs);
-	if (ret) {
-		dev_err(dev, "Cannot get regulators\n");
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret, "Cannot get regulators\n");
 
 	ret = mpu3050_power_up(mpu3050);
 	if (ret)
Signature · 1 line
2.51.0
Reviewed-by on v1 1/1
#2 lore raw
Quoted 3 lines · Svyatoslav Ryhel

Regulator requesting may result in deferred probing error which will abort driver probing. To avoid this just use dev_err_probe which handles deferred probing.

I believe this deserves a Fixes tag.

Anyway, the rest LGTM,

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#3 lore raw
Quoted 10 lines · On Thu, 22 Jan 2026 17:58:41 +0200 Andy Shevchenko…
Quoted 3 lines · Svyatoslav Ryhel

Regulator requesting may result in deferred probing error which will abort driver probing. To avoid this just use dev_err_probe which handles deferred probing.

I believe this deserves a Fixes tag.

Anyway, the rest LGTM,

Added one. It goes all the way back to:
3904b28efb2c ("iio: gyro: Add driver for the MPU-3050 gyroscope") in 2016.

Given age of issue and timing I've queued this for the next merge window.

Thanks,

Jonathan