]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drivers: iio: mpu3050: use dev_err_probe for regulator request
authorSvyatoslav Ryhel <clamor95@gmail.com>
Thu, 22 Jan 2026 15:34:25 +0000 (17:34 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 22 Jan 2026 20:53:18 +0000 (20:53 +0000)
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.

Fixes: 3904b28efb2c ("iio: gyro: Add driver for the MPU-3050 gyroscope")
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/gyro/mpu3050-core.c

index 67ae7d1012bc275fa2b49a0d5dc2c060ac84bb2d..ee2fcd20545dee025a524e749fbc392ab9049686 100644 (file)
@@ -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)