From: Uwe Kleine-König Date: Fri, 29 Mar 2024 10:35:40 +0000 (+0100) Subject: pwm: Fix setting period with #pwm-cells = <1> and of_pwm_single_xlate() X-Git-Tag: v6.9-rc1-pxa1908^0 X-Git-Url: https://git.dujemihanovic.xyz/?a=commitdiff_plain;h=ce76f675f0c3aec2c1cc011ef93eca286575668e;p=linux.git pwm: Fix setting period with #pwm-cells = <1> and of_pwm_single_xlate() For drivers making use of of_pwm_single_xlate() (i.e. those that don't pass a hwpwm index) and also don't pass flags, setting period was wrongly skipped. This affects the pwm-pxa and ti-sn65dsi86 drivers. Reported-by: Karel Balej Fixes: 40ade0c2e794 ("pwm: Let the of_xlate callbacks accept references without period") Signed-off-by: Uwe Kleine-König --- diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index d70f793ce4b3..403525cc1783 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -443,7 +443,7 @@ of_pwm_single_xlate(struct pwm_chip *chip, const struct of_phandle_args *args) if (IS_ERR(pwm)) return pwm; - if (args->args_count > 1) + if (args->args_count > 0) pwm->args.period = args->args[0]; pwm->args.polarity = PWM_POLARITY_NORMAL;