diff mbox series

[v5,RESEND,3/6] pwm: meson: remove not needed check in meson_pwm_calc

Message ID c6d59480-df25-9244-82ec-fcd26dbe5022@gmail.com (mailing list archive)
State New, archived
Headers show
Series pwm: meson: make full use of common clock framework | expand

Commit Message

Heiner Kallweit May 24, 2023, 7:49 p.m. UTC
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>
---
 drivers/pwm/pwm-meson.c | 5 -----
 1 file changed, 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c
index 33107204a..aad4a0ed3 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);