Skip to content

Commit bafa23b

Browse files
hkallweitthierryreding
authored andcommitted
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 <u.kleine-koenig@pengutronix.de> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
1 parent 87a2cbf commit bafa23b

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

drivers/pwm/pwm-meson.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,7 @@ static int meson_pwm_calc(struct meson_pwm *meson, struct pwm_device *pwm,
204204
channel->hi = 0;
205205
channel->lo = cnt;
206206
} else {
207-
/* Then check is we can have the duty with the same pre_div */
208207
duty_cnt = div64_u64(fin_freq * duty, NSEC_PER_SEC * (pre_div + 1));
209-
if (duty_cnt > 0xffff) {
210-
dev_err(meson->chip.dev, "unable to get duty cycle\n");
211-
return -EINVAL;
212-
}
213208

214209
dev_dbg(meson->chip.dev, "duty=%llu pre_div=%u duty_cnt=%u\n",
215210
duty, pre_div, duty_cnt);

0 commit comments

Comments
 (0)