[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210512075824.620580-1-axel.lin@ingics.com>
Date: Wed, 12 May 2021 15:58:24 +0800
From: Axel Lin <axel.lin@...ics.com>
To: Mark Brown <broonie@...nel.org>
Cc: Pi-Hsun Shih <pihsun@...omium.org>,
Liam Girdwood <lgirdwood@...il.com>,
linux-kernel@...r.kernel.org, Axel Lin <axel.lin@...ics.com>
Subject: [PATCH] regulator: cros-ec: Fix error code in dev_err message
Show proper error code instead of 0.
Signed-off-by: Axel Lin <axel.lin@...ics.com>
---
drivers/regulator/cros-ec-regulator.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/cros-ec-regulator.c b/drivers/regulator/cros-ec-regulator.c
index eb3fc1db4edc..c4754f3cf233 100644
--- a/drivers/regulator/cros-ec-regulator.c
+++ b/drivers/regulator/cros-ec-regulator.c
@@ -225,8 +225,9 @@ static int cros_ec_regulator_probe(struct platform_device *pdev)
drvdata->dev = devm_regulator_register(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);
- return PTR_ERR(drvdata->dev);
+ return ret;
}
platform_set_drvdata(pdev, drvdata);
--
2.25.1
Powered by blists - more mailing lists