summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2021-05-12 09:58:24 +0200
committerMark Brown <broonie@kernel.org>2021-05-12 14:01:41 +0200
commit3d681804efcb6e5d8089a433402e19179347d7ae (patch)
treee0a7bf09cd44f3788e99dda9cc8386c5b12464f5 /drivers
parentregulator: Add binding for TCS4525 (diff)
downloadlinux-3d681804efcb6e5d8089a433402e19179347d7ae.tar.xz
linux-3d681804efcb6e5d8089a433402e19179347d7ae.zip
regulator: cros-ec: Fix error code in dev_err message
Show proper error code instead of 0. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210512075824.620580-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/regulator/cros-ec-regulator.c3
1 files changed, 2 insertions, 1 deletions
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);