Skip to content

Commit 0251fa8

Browse files
mbriandUwe Kleine-König
authored andcommitted
pwm: max7360: Clean MAX7360 code
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>
1 parent 0559730 commit 0251fa8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/pwm/pwm-max7360.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static int max7360_pwm_round_waveform_tohw(struct pwm_chip *chip,
7575
duty_steps = MAX7360_PWM_MAX - 1;
7676
}
7777

78-
wfhw->duty_steps = min(MAX7360_PWM_MAX, duty_steps);
78+
wfhw->duty_steps = duty_steps;
7979
wfhw->enabled = !!wf->period_length_ns;
8080

8181
if (wf->period_length_ns && wf->period_length_ns < MAX7360_PWM_PERIOD_NS)

0 commit comments

Comments
 (0)