Skip to content

Commit 75c3543

Browse files
vwaxbroonie
authored andcommitted
regulator: virtual: use dev_err_probe()
Use dev_err_probe() to avoid printing spurious warnings on probe deferral. Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> Link: https://lore.kernel.org/r/20220301111831.3742383-2-vincent.whitchurch@axis.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent a94e5cd commit 75c3543

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

drivers/regulator/virtual.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,10 @@ static int regulator_virtual_probe(struct platform_device *pdev)
295295
mutex_init(&drvdata->lock);
296296

297297
drvdata->regulator = devm_regulator_get(&pdev->dev, reg_id);
298-
if (IS_ERR(drvdata->regulator)) {
299-
ret = PTR_ERR(drvdata->regulator);
300-
dev_err(&pdev->dev, "Failed to obtain supply '%s': %d\n",
301-
reg_id, ret);
302-
return ret;
303-
}
298+
if (IS_ERR(drvdata->regulator))
299+
return dev_err_probe(&pdev->dev, PTR_ERR(drvdata->regulator),
300+
"Failed to obtain supply '%s'\n",
301+
reg_id);
304302

305303
ret = sysfs_create_group(&pdev->dev.kobj,
306304
&regulator_virtual_attr_group);

0 commit comments

Comments
 (0)