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>
This commit is contained in:
Axel Lin 2021-05-12 15:58:24 +08:00 committed by Mark Brown
parent f80505fdff
commit 3d681804ef
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -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);