Skip to content

Commit 73dfe97

Browse files
author
Uwe Kleine-König
committed
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Fixes: 40ade0c ("pwm: Let the of_xlate callbacks accept references without period") Tested-by: Karel Balej <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Uwe Kleine-König <[email protected]>
1 parent 9eb0587 commit 73dfe97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pwm/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ of_pwm_single_xlate(struct pwm_chip *chip, const struct of_phandle_args *args)
443443
if (IS_ERR(pwm))
444444
return pwm;
445445

446-
if (args->args_count > 1)
446+
if (args->args_count > 0)
447447
pwm->args.period = args->args[0];
448448

449449
pwm->args.polarity = PWM_POLARITY_NORMAL;

0 commit comments

Comments
 (0)