public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/1] drivers: iio: mpu3050: use dev_err_probe for regulator request
@ 2026-01-22 15:34 Svyatoslav Ryhel
  2026-01-22 15:34 ` [PATCH v1 1/1] " Svyatoslav Ryhel
  0 siblings, 1 reply; 4+ messages in thread
From: Svyatoslav Ryhel @ 2026-01-22 15:34 UTC (permalink / raw)
  To: Linus Walleij, Jonathan Cameron, David Lechner, Nuno Sá,
	Andy Shevchenko, Svyatoslav Ryhel
  Cc: linux-iio, linux-kernel

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(-)

-- 
2.51.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1 1/1] drivers: iio: mpu3050: use dev_err_probe for regulator request
  2026-01-22 15:34 [PATCH v1 0/1] drivers: iio: mpu3050: use dev_err_probe for regulator request Svyatoslav Ryhel
@ 2026-01-22 15:34 ` Svyatoslav Ryhel
  2026-01-22 15:58   ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Svyatoslav Ryhel @ 2026-01-22 15:34 UTC (permalink / raw)
  To: Linus Walleij, Jonathan Cameron, David Lechner, Nuno Sá,
	Andy Shevchenko, Svyatoslav Ryhel
  Cc: linux-iio, linux-kernel

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.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
 drivers/iio/gyro/mpu3050-core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c
index 67ae7d1012bc..ee2fcd20545d 100644
--- a/drivers/iio/gyro/mpu3050-core.c
+++ b/drivers/iio/gyro/mpu3050-core.c
@@ -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)
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/1] drivers: iio: mpu3050: use dev_err_probe for regulator request
  2026-01-22 15:34 ` [PATCH v1 1/1] " Svyatoslav Ryhel
@ 2026-01-22 15:58   ` Andy Shevchenko
  2026-01-22 20:33     ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2026-01-22 15:58 UTC (permalink / raw)
  To: Svyatoslav Ryhel
  Cc: Linus Walleij, Jonathan Cameron, David Lechner, Nuno Sá,
	Andy Shevchenko, linux-iio, linux-kernel

On Thu, Jan 22, 2026 at 05:34:25PM +0200, Svyatoslav Ryhel wrote:
> 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,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/1] drivers: iio: mpu3050: use dev_err_probe for regulator request
  2026-01-22 15:58   ` Andy Shevchenko
@ 2026-01-22 20:33     ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2026-01-22 20:33 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Svyatoslav Ryhel, Linus Walleij, David Lechner, Nuno Sá,
	Andy Shevchenko, linux-iio, linux-kernel

On Thu, 22 Jan 2026 17:58:41 +0200
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:

> On Thu, Jan 22, 2026 at 05:34:25PM +0200, Svyatoslav Ryhel wrote:
> > 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,
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> 

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-22 20:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-22 15:34 [PATCH v1 0/1] drivers: iio: mpu3050: use dev_err_probe for regulator request Svyatoslav Ryhel
2026-01-22 15:34 ` [PATCH v1 1/1] " Svyatoslav Ryhel
2026-01-22 15:58   ` Andy Shevchenko
2026-01-22 20:33     ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox