From: Axel Lin Date: Wed, 12 May 2021 07:58:24 +0000 (+0800) Subject: regulator: cros-ec: Fix error code in dev_err message X-Git-Tag: accepted/tizen/unified/20230118.172025~7106^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d681804efcb6e5d8089a433402e19179347d7ae;p=platform%2Fkernel%2Flinux-rpi.git regulator: cros-ec: Fix error code in dev_err message Show proper error code instead of 0. Signed-off-by: Axel Lin Link: https://lore.kernel.org/r/20210512075824.620580-1-axel.lin@ingics.com Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/cros-ec-regulator.c b/drivers/regulator/cros-ec-regulator.c index eb3fc1d..c4754f3 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);