]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pwm: Remove redundant check in pwm_ops_check()
authorBen Zong-You Xie <ben717@andestech.com>
Thu, 29 Jan 2026 06:43:34 +0000 (14:43 +0800)
committerUwe Kleine-König <ukleinek@kernel.org>
Fri, 30 Jan 2026 10:04:44 +0000 (11:04 +0100)
ops->write_waveform is already known to be non-NULL so there is
no need to check it a second time.

The superflous check was introduced in commit 17e40c25158f
("pwm: New abstraction for PWM waveforms").

Signed-off-by: Ben Zong-You Xie <ben717@andestech.com>
Link: https://patch.msgid.link/20260129-fix-pwm-ops-check-v1-1-6f0b7952c875@andestech.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
drivers/pwm/core.c

index 41fd3a9b288373491709b78e819260474d7d3926..8da78b4b21b97007b3e40486c009914fd6ee789d 100644 (file)
@@ -1699,8 +1699,7 @@ static bool pwm_ops_check(const struct pwm_chip *chip)
 
        if (ops->write_waveform) {
                if (!ops->round_waveform_tohw ||
-                   !ops->round_waveform_fromhw ||
-                   !ops->write_waveform)
+                   !ops->round_waveform_fromhw)
                        return false;
 
                if (PWM_WFHWSIZE < ops->sizeof_wfhw) {