Skip to content

Commit 4430d02

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: lpc18xx-sct: Don't modify the cached period of other PWM outputs
Even though the hardware only supports a single period for all PWM outputs, modifying the other (disabled) outputs's period is strange and wrong. Only the pwm core is supposed to update these values. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent b41ccc3 commit 4430d02

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/pwm/pwm-lpc18xx-sct.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ static int lpc18xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
194194
int duty_ns, int period_ns)
195195
{
196196
struct lpc18xx_pwm_chip *lpc18xx_pwm = to_lpc18xx_pwm_chip(chip);
197-
int requested_events, i;
197+
int requested_events;
198198

199199
if (period_ns < lpc18xx_pwm->min_period_ns ||
200200
period_ns > lpc18xx_pwm->max_period_ns) {
@@ -223,8 +223,6 @@ static int lpc18xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
223223
if ((requested_events <= 2 && lpc18xx_pwm->period_ns != period_ns) ||
224224
!lpc18xx_pwm->period_ns) {
225225
lpc18xx_pwm->period_ns = period_ns;
226-
for (i = 0; i < chip->npwm; i++)
227-
pwm_set_period(&chip->pwms[i], period_ns);
228226
lpc18xx_pwm_config_period(chip, period_ns);
229227
}
230228

0 commit comments

Comments
 (0)