]> Gentwo Git Trees - linux/.git/commitdiff
pwm: max7360: Clean MAX7360 code
authorMathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Wed, 24 Sep 2025 09:06:40 +0000 (11:06 +0200)
committerUwe Kleine-König <ukleinek@kernel.org>
Fri, 14 Nov 2025 10:56:14 +0000 (11:56 +0100)
Duty steps computation can never end in values higher than
MAX7360_PWM_MAX: remove useless use of min().

Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Suggested-by: Uwe Kleine-König <ukleinek@kernel.org>
Link: https://patch.msgid.link/20250924-mdb-max7360-pwm-optimize-v1-1-5959eeed20d8@bootlin.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
drivers/pwm/pwm-max7360.c

index ebf93a7aee5be4cfdac89601b78e6d20955f4877..16261958ce7ffb261b5a7cc7b1d47f63d6d398c2 100644 (file)
@@ -75,7 +75,7 @@ static int max7360_pwm_round_waveform_tohw(struct pwm_chip *chip,
                        duty_steps = MAX7360_PWM_MAX - 1;
        }
 
-       wfhw->duty_steps = min(MAX7360_PWM_MAX, duty_steps);
+       wfhw->duty_steps = duty_steps;
        wfhw->enabled = !!wf->period_length_ns;
 
        if (wf->period_length_ns && wf->period_length_ns < MAX7360_PWM_PERIOD_NS)