Commit 1030b5bc authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Jonathan Cameron

iio: adc: exynos_adc: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-4-krzk@kernel.orgSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 55dc2952
...@@ -844,13 +844,9 @@ static int exynos_adc_probe(struct platform_device *pdev) ...@@ -844,13 +844,9 @@ static int exynos_adc_probe(struct platform_device *pdev)
} }
info->vdd = devm_regulator_get(&pdev->dev, "vdd"); info->vdd = devm_regulator_get(&pdev->dev, "vdd");
if (IS_ERR(info->vdd)) { if (IS_ERR(info->vdd))
if (PTR_ERR(info->vdd) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(info->vdd),
dev_err(&pdev->dev, "failed getting regulator");
"failed getting regulator, err = %ld\n",
PTR_ERR(info->vdd));
return PTR_ERR(info->vdd);
}
ret = regulator_enable(info->vdd); ret = regulator_enable(info->vdd);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment