clk: sunxi-ng: ccu-sun9i-a80-de: 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> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Link: https://lore.kernel.org/r/20220827094151.3323450-2-yangyingliang@huawei.com
This commit is contained in:
parent
5c05a33ea2
commit
655489854f
|
@ -213,21 +213,14 @@ static int sun9i_a80_de_clk_probe(struct platform_device *pdev)
|
||||||
return PTR_ERR(reg);
|
return PTR_ERR(reg);
|
||||||
|
|
||||||
bus_clk = devm_clk_get(&pdev->dev, "bus");
|
bus_clk = devm_clk_get(&pdev->dev, "bus");
|
||||||
if (IS_ERR(bus_clk)) {
|
if (IS_ERR(bus_clk))
|
||||||
ret = PTR_ERR(bus_clk);
|
return dev_err_probe(&pdev->dev, PTR_ERR(bus_clk),
|
||||||
if (ret != -EPROBE_DEFER)
|
"Couldn't get bus clk\n");
|
||||||
dev_err(&pdev->dev, "Couldn't get bus clk: %d\n", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
|
rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
|
||||||
if (IS_ERR(rstc)) {
|
if (IS_ERR(rstc))
|
||||||
ret = PTR_ERR(rstc);
|
return dev_err_probe(&pdev->dev, PTR_ERR(rstc),
|
||||||
if (ret != -EPROBE_DEFER)
|
"Couldn't get reset control\n");
|
||||||
dev_err(&pdev->dev,
|
|
||||||
"Couldn't get reset control: %d\n", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The bus clock needs to be enabled for us to access the registers */
|
/* The bus clock needs to be enabled for us to access the registers */
|
||||||
ret = clk_prepare_enable(bus_clk);
|
ret = clk_prepare_enable(bus_clk);
|
||||||
|
|
Loading…
Reference in New Issue