Commit 4b8857c3 authored by zhaoxiao's avatar zhaoxiao Committed by Thierry Reding

pwm: rockchip: Convert to use dev_err_probe()

It's fine to call dev_err_probe() in ->probe() when error code is known.
Convert the driver to use dev_err_probe().
Signed-off-by: default avatarzhaoxiao <zhaoxiao@uniontech.com>
Reviewed-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 568035b0
...@@ -328,22 +328,16 @@ static int rockchip_pwm_probe(struct platform_device *pdev) ...@@ -328,22 +328,16 @@ static int rockchip_pwm_probe(struct platform_device *pdev)
else else
pc->pclk = pc->clk; pc->pclk = pc->clk;
if (IS_ERR(pc->pclk)) { if (IS_ERR(pc->pclk))
ret = PTR_ERR(pc->pclk); return dev_err_probe(&pdev->dev, PTR_ERR(pc->pclk), "Can't get APB clk\n");
if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "Can't get APB clk: %d\n", ret);
return ret;
}
ret = clk_prepare_enable(pc->clk); ret = clk_prepare_enable(pc->clk);
if (ret) { if (ret)
dev_err(&pdev->dev, "Can't prepare enable PWM clk: %d\n", ret); return dev_err_probe(&pdev->dev, ret, "Can't prepare enable PWM clk\n");
return ret;
}
ret = clk_prepare_enable(pc->pclk); ret = clk_prepare_enable(pc->pclk);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Can't prepare enable APB clk: %d\n", ret); dev_err_probe(&pdev->dev, ret, "Can't prepare enable APB clk\n");
goto err_clk; goto err_clk;
} }
...@@ -360,7 +354,7 @@ static int rockchip_pwm_probe(struct platform_device *pdev) ...@@ -360,7 +354,7 @@ static int rockchip_pwm_probe(struct platform_device *pdev)
ret = pwmchip_add(&pc->chip); ret = pwmchip_add(&pc->chip);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret); dev_err_probe(&pdev->dev, ret, "pwmchip_add() failed\n");
goto err_pclk; goto err_pclk;
} }
......
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