]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
regulator: tps65219: Use dev_err_probe() instead of dev_err()
authorShree Ramamoorthy <s-ramamoorthy@ti.com>
Tue, 17 Dec 2024 20:45:23 +0000 (14:45 -0600)
committerMark Brown <broonie@kernel.org>
Tue, 17 Dec 2024 21:19:59 +0000 (21:19 +0000)
Make the error message format unified by switching from dev_err() to
dev_err_probe() where there is a chance of -EPROBE_DEFER returned. This
helps simplify the error code where possible.

Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com>
Link: https://patch.msgid.link/20241217204526.1010989-2-s-ramamoorthy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/tps65219-regulator.c

index b4065356392f0616aeb923361a446d6134641389..14d843a99d0fe9e9d04f613c70dce2a5177dc734 100644 (file)
@@ -322,11 +322,11 @@ static int tps65219_regulator_probe(struct platform_device *pdev)
                dev_dbg(tps->dev, "%s regul i= %d START", __func__, i);
                rdev = devm_regulator_register(&pdev->dev, &regulators[i],
                                               &config);
-               if (IS_ERR(rdev)) {
-                       dev_err(tps->dev, "failed to register %s regulator\n",
-                               regulators[i].name);
-                       return PTR_ERR(rdev);
-               }
+               if (IS_ERR(rdev))
+                       return dev_err_probe(tps->dev, PTR_ERR(rdev),
+                                       "Failed to register %s regulator\n",
+                                       regulators[i].name);
+
                rdevtbl[i] = rdev;
                dev_dbg(tps->dev, "%s regul i= %d COMPLETED", __func__, i);
        }