[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220817055949.20497-1-zhaoxiao@uniontech.com>
Date: Wed, 17 Aug 2022 13:59:49 +0800
From: zhaoxiao <zhaoxiao@...ontech.com>
To: thierry.reding@...il.com, heiko@...ech.de
Cc: u.kleine-koenig@...gutronix.de, linux-pwm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
zhaoxiao <zhaoxiao@...ontech.com>
Subject: [PATCH] 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: zhaoxiao <zhaoxiao@...ontech.com>
---
drivers/pwm/pwm-rockchip.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/pwm/pwm-rockchip.c b/drivers/pwm/pwm-rockchip.c
index f3647b317152..bd7ab37aaf88 100644
--- a/drivers/pwm/pwm-rockchip.c
+++ b/drivers/pwm/pwm-rockchip.c
@@ -331,15 +331,12 @@ static int rockchip_pwm_probe(struct platform_device *pdev)
if (IS_ERR(pc->pclk)) {
ret = PTR_ERR(pc->pclk);
if (ret != -EPROBE_DEFER)
- dev_err(&pdev->dev, "Can't get APB clk: %d\n", ret);
- return ret;
+ return dev_err_probe(&pdev->dev, ret, "Can't get APB clk: %d\n");
}
ret = clk_prepare_enable(pc->clk);
- if (ret) {
- dev_err(&pdev->dev, "Can't prepare enable PWM clk: %d\n", ret);
- return ret;
- }
+ if (ret)
+ dev_err_probe(&pdev->dev, ret, "Can't prepare enable PWM clk: %d\n");
ret = clk_prepare_enable(pc->pclk);
if (ret) {
--
2.20.1
Powered by blists - more mailing lists