clk: clocking-wizard: Use dev_err_probe() helper

dev_err() can be replace with dev_err_probe() which will check if error
code is -EPROBE_DEFER.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220913031442.980720-1-yangyingliang@huawei.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
Yang Yingliang 2022-09-13 11:14:42 +08:00 коммит произвёл Stephen Boyd
Родитель e8db788d68
Коммит fd30ac84f3
1 изменённых файлов: 6 добавлений и 10 удалений

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

@ -448,18 +448,14 @@ static int clk_wzrd_probe(struct platform_device *pdev)
} }
clk_wzrd->clk_in1 = devm_clk_get(&pdev->dev, "clk_in1"); clk_wzrd->clk_in1 = devm_clk_get(&pdev->dev, "clk_in1");
if (IS_ERR(clk_wzrd->clk_in1)) { if (IS_ERR(clk_wzrd->clk_in1))
if (clk_wzrd->clk_in1 != ERR_PTR(-EPROBE_DEFER)) return dev_err_probe(&pdev->dev, PTR_ERR(clk_wzrd->clk_in1),
dev_err(&pdev->dev, "clk_in1 not found\n"); "clk_in1 not found\n");
return PTR_ERR(clk_wzrd->clk_in1);
}
clk_wzrd->axi_clk = devm_clk_get(&pdev->dev, "s_axi_aclk"); clk_wzrd->axi_clk = devm_clk_get(&pdev->dev, "s_axi_aclk");
if (IS_ERR(clk_wzrd->axi_clk)) { if (IS_ERR(clk_wzrd->axi_clk))
if (clk_wzrd->axi_clk != ERR_PTR(-EPROBE_DEFER)) return dev_err_probe(&pdev->dev, PTR_ERR(clk_wzrd->axi_clk),
dev_err(&pdev->dev, "s_axi_aclk not found\n"); "s_axi_aclk not found\n");
return PTR_ERR(clk_wzrd->axi_clk);
}
ret = clk_prepare_enable(clk_wzrd->axi_clk); ret = clk_prepare_enable(clk_wzrd->axi_clk);
if (ret) { if (ret) {
dev_err(&pdev->dev, "enabling s_axi_aclk failed\n"); dev_err(&pdev->dev, "enabling s_axi_aclk failed\n");