diff options
| author | Heiner Kallweit <[email protected]> | 2023-05-24 19:49:56 +0000 |
|---|---|---|
| committer | Thierry Reding <[email protected]> | 2023-06-23 13:37:36 +0000 |
| commit | bafa23b6c07caac63a9637e83a605c26771b43ee (patch) | |
| tree | 08f54bb2e84509e46cb56ac23a27d4073770a4a8 /drivers/pwm/pwm-meson.c | |
| parent | pwm: meson: fix handling of period/duty if greater than UINT_MAX (diff) | |
| download | kernel-bafa23b6c07caac63a9637e83a605c26771b43ee.tar.gz kernel-bafa23b6c07caac63a9637e83a605c26771b43ee.zip | |
pwm: meson: remove not needed check in meson_pwm_calc
period >= duty implies that cnt >= duty_cnt. We verified before
that cnt <= 0xffff, therefore we can omit the check here.
Suggested-by: Uwe Kleine-König <[email protected]>
Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Diffstat (limited to 'drivers/pwm/pwm-meson.c')
| -rw-r--r-- | drivers/pwm/pwm-meson.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c index 33107204a951..aad4a0ed3b5a 100644 --- a/drivers/pwm/pwm-meson.c +++ b/drivers/pwm/pwm-meson.c @@ -204,12 +204,7 @@ static int meson_pwm_calc(struct meson_pwm *meson, struct pwm_device *pwm, channel->hi = 0; channel->lo = cnt; } else { - /* Then check is we can have the duty with the same pre_div */ duty_cnt = div64_u64(fin_freq * duty, NSEC_PER_SEC * (pre_div + 1)); - if (duty_cnt > 0xffff) { - dev_err(meson->chip.dev, "unable to get duty cycle\n"); - return -EINVAL; - } dev_dbg(meson->chip.dev, "duty=%llu pre_div=%u duty_cnt=%u\n", duty, pre_div, duty_cnt); |
