From 1a742dcd1f5c9d3c23be02db0118cfba8370f75e Mon Sep 17 00:00:00 2001 From: Damon Ding Date: Thu, 5 Dec 2024 16:01:56 +0800 Subject: [PATCH] pwm: rockchip: fix the return value check of .get_biphasic_result() Without this patch, the pclk may not be disabled if failed to get biphasic counter result. Fixes: 7a42db27aa15 ("pwm: rockchip: support for biphasic counter mode") Change-Id: I5dd279fb1cbfc493531b95181464e2c7d3a4cea9 Signed-off-by: Damon Ding --- drivers/pwm/pwm-rockchip.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pwm/pwm-rockchip.c b/drivers/pwm/pwm-rockchip.c index 3b8a5945dd56..f210b055f5b5 100644 --- a/drivers/pwm/pwm-rockchip.c +++ b/drivers/pwm/pwm-rockchip.c @@ -1834,11 +1834,9 @@ int rockchip_pwm_get_biphasic_result(struct pwm_device *pwm, unsigned long *biph return ret; ret = pc->data->funcs.get_biphasic_result(chip, pwm, biphasic_res); - if (ret) { + if (ret) dev_err(chip->dev, "Failed to get biphasic counter result for PWM%d\n", pc->channel_id); - return -EINVAL; - } clk_disable(pc->pclk);