diff mbox series

[v2,09/11] pwm: rockchip: Propagate errors in .get_state() to the caller

Message ID 20221130152148.2769768-10-u.kleine-koenig@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series pwm: Allow .get_state to fail | expand

Commit Message

Uwe Kleine-König Nov. 30, 2022, 3:21 p.m. UTC
.get_state() can return an error indication. Make use of it to propagate
failing hardware accesses.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/pwm/pwm-rockchip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Heiko Stuebner Nov. 30, 2022, 6:37 p.m. UTC | #1
Am Mittwoch, 30. November 2022, 16:21:46 CET schrieb Uwe Kleine-König:
> .get_state() can return an error indication. Make use of it to propagate
> failing hardware accesses.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>
diff mbox series

Patch

diff --git a/drivers/pwm/pwm-rockchip.c b/drivers/pwm/pwm-rockchip.c
index 3ec7d1756903..7f084eb34092 100644
--- a/drivers/pwm/pwm-rockchip.c
+++ b/drivers/pwm/pwm-rockchip.c
@@ -70,11 +70,11 @@  static int rockchip_pwm_get_state(struct pwm_chip *chip,
 
 	ret = clk_enable(pc->pclk);
 	if (ret)
-		return 0;
+		return ret;
 
 	ret = clk_enable(pc->clk);
 	if (ret)
-		return 0;
+		return ret;
 
 	clk_rate = clk_get_rate(pc->clk);