rtc: s3c: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20200830080937.14367-1-krzk@kernel.org
This commit is contained in:
Krzysztof Kozlowski 2020-08-30 10:09:37 +02:00 коммит произвёл Alexandre Belloni
Родитель 0d982de3e2
Коммит c52d270c68
1 изменённых файлов: 2 добавлений и 7 удалений

Просмотреть файл

@ -494,13 +494,8 @@ static int s3c_rtc_probe(struct platform_device *pdev)
if (info->data->needs_src_clk) {
info->rtc_src_clk = devm_clk_get(&pdev->dev, "rtc_src");
if (IS_ERR(info->rtc_src_clk)) {
ret = PTR_ERR(info->rtc_src_clk);
if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev,
"failed to find rtc source clock\n");
else
dev_dbg(&pdev->dev,
"probe deferred due to missing rtc src clk\n");
ret = dev_err_probe(&pdev->dev, PTR_ERR(info->rtc_src_clk),
"failed to find rtc source clock\n");
goto err_src_clk;
}
ret = clk_prepare_enable(info->rtc_src_clk);