From: Artur Weber Date: Thu, 15 May 2025 14:16:32 +0000 (+0200) Subject: regulator: bcm590xx: Use dev_err_probe for regulator register error X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=37512643e1f889549e4f9632d6bccef6804cb776;p=linux.git regulator: bcm590xx: Use dev_err_probe for regulator register error Instead of calling dev_err() and returning PTR_ERR(...) separately, use a single "return dev_err_probe" statement. Signed-off-by: Artur Weber Reviewed-by: Stanislav Jakubek Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20250515-bcm59054-v9-5-14ba0ea2ea5b@gmail.com Signed-off-by: Lee Jones --- diff --git a/drivers/regulator/bcm590xx-regulator.c b/drivers/regulator/bcm590xx-regulator.c index 9f0cda46b015..a17311fa30e4 100644 --- a/drivers/regulator/bcm590xx-regulator.c +++ b/drivers/regulator/bcm590xx-regulator.c @@ -340,12 +340,10 @@ static int bcm590xx_probe(struct platform_device *pdev) rdev = devm_regulator_register(&pdev->dev, &pmu->desc[i], &config); - if (IS_ERR(rdev)) { - dev_err(bcm590xx->dev, - "failed to register %s regulator\n", - pdev->name); - return PTR_ERR(rdev); - } + if (IS_ERR(rdev)) + return dev_err_probe(bcm590xx->dev, PTR_ERR(rdev), + "failed to register %s regulator\n", + pdev->name); } return 0;