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: 7a42db27aa ("pwm: rockchip: support for biphasic counter mode")
Change-Id: I5dd279fb1cbfc493531b95181464e2c7d3a4cea9
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
This commit is contained in:
Damon Ding
2024-12-05 16:01:56 +08:00
committed by Tao Huang
parent 14cf391f07
commit 1a742dcd1f

View File

@@ -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);