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: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20200829064726.26268-4-krzk@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
55dc295200
commit
1030b5bc68
|
@ -844,13 +844,9 @@ static int exynos_adc_probe(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
info->vdd = devm_regulator_get(&pdev->dev, "vdd");
|
||||
if (IS_ERR(info->vdd)) {
|
||||
if (PTR_ERR(info->vdd) != -EPROBE_DEFER)
|
||||
dev_err(&pdev->dev,
|
||||
"failed getting regulator, err = %ld\n",
|
||||
PTR_ERR(info->vdd));
|
||||
return PTR_ERR(info->vdd);
|
||||
}
|
||||
if (IS_ERR(info->vdd))
|
||||
return dev_err_probe(&pdev->dev, PTR_ERR(info->vdd),
|
||||
"failed getting regulator");
|
||||
|
||||
ret = regulator_enable(info->vdd);
|
||||
if (ret)
|
||||
|
|
Loading…
Reference in New Issue