pwm: samsung: Remove redundant checks from pwm_samsung_config()
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Mon, 24 Apr 2017 10:01:07 +0000 (12:01 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Mon, 21 Aug 2017 08:39:11 +0000 (10:39 +0200)
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>
drivers/pwm/pwm-samsung.c

index f113cda47032e8c48f5ee9791d306af3b8d4e809..9ea7638228c878ce001ef29b8ecc916a3587b4e0 100644 (file)
@@ -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));