Commit 0251fa88 authored by Mathieu Dubois-Briand's avatar Mathieu Dubois-Briand Committed by Uwe Kleine-König
Browse files

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: default avatarMathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Suggested-by: default avatarUwe Kleine-König <ukleinek@kernel.org>
Link: https://patch.msgid.link/20250924-mdb-max7360-pwm-optimize-v1-1-5959eeed20d8@bootlin.com


Signed-off-by: default avatarUwe Kleine-König <ukleinek@kernel.org>
parent 0559730b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)