diff options
| author | Krzysztof Kozlowski <[email protected]> | 2020-08-26 14:47:44 +0000 |
|---|---|---|
| committer | Thierry Reding <[email protected]> | 2020-09-24 07:18:10 +0000 |
| commit | 836719f8948a0a485029e2308dbe864a33f6941d (patch) | |
| tree | 1739120753af3bc2d78b15c148f0142b7353c00c /drivers/pwm/pwm-rockchip.c | |
| parent | pwm: jz4740: Simplify with dev_err_probe() (diff) | |
| download | kernel-836719f8948a0a485029e2308dbe864a33f6941d.tar.gz kernel-836719f8948a0a485029e2308dbe864a33f6941d.zip | |
pwm: rockchip: 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 <[email protected]>
Acked-by: Uwe Kleine-König <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Diffstat (limited to 'drivers/pwm/pwm-rockchip.c')
| -rw-r--r-- | drivers/pwm/pwm-rockchip.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/pwm/pwm-rockchip.c b/drivers/pwm/pwm-rockchip.c index 098e94335cb5..77c23a2c6d71 100644 --- a/drivers/pwm/pwm-rockchip.c +++ b/drivers/pwm/pwm-rockchip.c @@ -307,13 +307,9 @@ static int rockchip_pwm_probe(struct platform_device *pdev) pc->clk = devm_clk_get(&pdev->dev, "pwm"); if (IS_ERR(pc->clk)) { pc->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(pc->clk)) { - ret = PTR_ERR(pc->clk); - if (ret != -EPROBE_DEFER) - dev_err(&pdev->dev, "Can't get bus clk: %d\n", - ret); - return ret; - } + if (IS_ERR(pc->clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(pc->clk), + "Can't get bus clk\n"); } count = of_count_phandle_with_args(pdev->dev.of_node, |
