]> Git Repo - linux.git/commitdiff
regulator: fixed: use dev_err_probe for register
authorChris Morgan <[email protected]>
Wed, 21 Jul 2021 16:57:16 +0000 (11:57 -0500)
committerMark Brown <[email protected]>
Thu, 22 Jul 2021 11:40:12 +0000 (12:40 +0100)
Instead of returning error directly, use dev_err_probe. This avoids
messages in the dmesg log for devices which will be probed again later.

Signed-off-by: Chris Morgan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
drivers/regulator/fixed.c

index 39284610a53664c1960f32b27ac05540bfe801bb..599ad201dca758a64c97ed88622097859e306862 100644 (file)
@@ -287,8 +287,9 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
        drvdata->dev = devm_regulator_register(&pdev->dev, &drvdata->desc,
                                               &cfg);
        if (IS_ERR(drvdata->dev)) {
-               ret = PTR_ERR(drvdata->dev);
-               dev_err(&pdev->dev, "Failed to register regulator: %d\n", ret);
+               ret = dev_err_probe(&pdev->dev, PTR_ERR(drvdata->dev),
+                                   "Failed to register regulator: %ld\n",
+                                   PTR_ERR(drvdata->dev));
                return ret;
        }
 
This page took 0.05926 seconds and 4 git commands to generate.