Skip to content
Commit 6b9352f3 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Thierry Reding
Browse files

pwm: meson: modify and simplify calculation in meson_pwm_get_state

I don't see a reason why we should treat the case lo < hi differently
and return 0 as period and duty_cycle. The current logic was added with
c375bcba ("pwm: meson: Read the full hardware state in
meson_pwm_get_state()"), Martin as original author doesn't remember why
it was implemented this way back then.
So let's handle it as normal use case and also remove the optimization
for lo == 0. I think the improved readability is worth it.

Fixes: c375bcba

 ("pwm: meson: Read the full hardware state in meson_pwm_get_state()")
Reviewed-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: default avatarDmitry Rokosov <ddrokosov@sberdevices.ru>
Acked-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 5442c33f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment