From: Dan Carpenter Date: Wed, 30 Aug 2017 14:03:58 +0000 (+0300) Subject: regulator: da9063: Return an error code on probe failure X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b6615659827839f3031c6bd4c1599c3c705778ac;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git regulator: da9063: Return an error code on probe failure If "regl_pdata->n_regulators == 0" is true then we accidentally return PTR_ERR() instead of an error code. I've changed it to return -ENODEV instead. Fixes: 69ca3e58d178 ("regulator: da9063: Add Dialog DA9063 voltage regulators support.") Signed-off-by: Dan Carpenter Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c index c6af343f54ea..6a8f9cd69f52 100644 --- a/drivers/regulator/da9063-regulator.c +++ b/drivers/regulator/da9063-regulator.c @@ -736,7 +736,7 @@ static int da9063_regulator_probe(struct platform_device *pdev) if (IS_ERR(regl_pdata) || regl_pdata->n_regulators == 0) { dev_err(&pdev->dev, "No regulators defined for the platform\n"); - return PTR_ERR(regl_pdata); + return -ENODEV; } /* Find regulators set for particular device model */