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 |
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 --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);
.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(-)