Skip to content

Commit

Permalink
pwm: samsung: Remove redundant checks from pwm_samsung_config()
Browse files Browse the repository at this point in the history
If the requested period_ns and duty_ns values are identical to the last
programmed ones pwm_samsung_config() returns early and skips the
hardware configuration. The same checks are now done by the PWM core so
the driver specific ones can be removed.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
  • Loading branch information
bzolnier authored and thierryreding committed Aug 21, 2017
1 parent 8bdb65d commit 23aa19a
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/pwm/pwm-samsung.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,6 @@ static int pwm_samsung_config(struct pwm_chip *chip, struct pwm_device *pwm,
if (period_ns > NSEC_PER_SEC)
return -ERANGE;

if (period_ns == chan->period_ns && duty_ns == chan->duty_ns)
return 0;

tcnt = readl(our_chip->base + REG_TCNTB(pwm->hwpwm));
oldtcmp = readl(our_chip->base + REG_TCMPB(pwm->hwpwm));

Expand Down

0 comments on commit 23aa19a

Please sign in to comment.