[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220301111831.3742383-2-vincent.whitchurch@axis.com>
Date: Tue, 1 Mar 2022 12:18:29 +0100
From: Vincent Whitchurch <vincent.whitchurch@...s.com>
To: <lgirdwood@...il.com>, <broonie@...nel.org>
CC: <kernel@...s.com>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
Vincent Whitchurch <vincent.whitchurch@...s.com>
Subject: [PATCH v2 1/3] 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@...s.com>
---
drivers/regulator/virtual.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/regulator/virtual.c b/drivers/regulator/virtual.c
index 52c5a0e0acd8..50d2e9caaa71 100644
--- a/drivers/regulator/virtual.c
+++ b/drivers/regulator/virtual.c
@@ -295,12 +295,10 @@ static int regulator_virtual_probe(struct platform_device *pdev)
mutex_init(&drvdata->lock);
drvdata->regulator = devm_regulator_get(&pdev->dev, reg_id);
- if (IS_ERR(drvdata->regulator)) {
- ret = PTR_ERR(drvdata->regulator);
- dev_err(&pdev->dev, "Failed to obtain supply '%s': %d\n",
- reg_id, ret);
- return ret;
- }
+ if (IS_ERR(drvdata->regulator))
+ return dev_err_probe(&pdev->dev, PTR_ERR(drvdata->regulator),
+ "Failed to obtain supply '%s'\n",
+ reg_id);
ret = sysfs_create_group(&pdev->dev.kobj,
®ulator_virtual_attr_group);
--
2.34.1
Powered by blists - more mailing lists