[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250924-mdb-max7360-pwm-optimize-v1-1-5959eeed20d8@bootlin.com>
Date: Wed, 24 Sep 2025 11:06:40 +0200
From: Mathieu Dubois-Briand <mathieu.dubois-briand@...tlin.com>
To: Uwe Kleine-König <ukleinek@...nel.org>
Cc: Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
linux-pwm@...r.kernel.org, linux-kernel@...r.kernel.org,
Mathieu Dubois-Briand <mathieu.dubois-briand@...tlin.com>
Subject: [PATCH] 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@...tlin.com>
---
This was discussed in the MAX7360 series[1], and I believe we can indeed
remove this check.
[1] https://lore.kernel.org/all/20250824-mdb-max7360-support-v14-0-435cfda2b1ea@bootlin.com/
---
drivers/pwm/pwm-max7360.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pwm/pwm-max7360.c b/drivers/pwm/pwm-max7360.c
index ebf93a7aee5be4cfdac89601b78e6d20955f4877..16261958ce7ffb261b5a7cc7b1d47f63d6d398c2 100644
--- a/drivers/pwm/pwm-max7360.c
+++ b/drivers/pwm/pwm-max7360.c
@@ -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)
---
base-commit: ce7f1a983b074f6cf8609068088ca3182c569ee4
change-id: 20250924-mdb-max7360-pwm-optimize-bcdae528f579
Best regards,
--
Mathieu Dubois-Briand <mathieu.dubois-briand@...tlin.com>
Powered by blists - more mailing lists