[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250902130348.2630053-1-colin.i.king@gmail.com>
Date: Tue, 2 Sep 2025 14:03:48 +0100
From: Colin Ian King <colin.i.king@...il.com>
To: Uwe Kleine-König <ukleinek@...nel.org>,
linux-pwm@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH][next] pwm: Fix incorrect variable used in error message
The dev_err message is reporting the incorrect return value ret_tohw,
it should be reporting the value in ret_fromhw. Fix this by using
ret_fromhw instead of ret_tohw.
Fixes: 6c5126c6406d ("pwm: Provide new consumer API functions for waveforms")
Signed-off-by: Colin Ian King <colin.i.king@...il.com>
---
drivers/pwm/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index ec4112e6209a..ea2ccf42e814 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -276,7 +276,7 @@ int pwm_round_waveform_might_sleep(struct pwm_device *pwm, struct pwm_waveform *
if (IS_ENABLED(CONFIG_PWM_DEBUG) && ret_fromhw > 0)
dev_err(&chip->dev, "Unexpected return value from __pwm_round_waveform_fromhw: requested %llu/%llu [+%llu], return value %d\n",
- wf_req.duty_length_ns, wf_req.period_length_ns, wf_req.duty_offset_ns, ret_tohw);
+ wf_req.duty_length_ns, wf_req.period_length_ns, wf_req.duty_offset_ns, ret_fromhw);
if (IS_ENABLED(CONFIG_PWM_DEBUG) &&
(ret_tohw == 0) != pwm_check_rounding(&wf_req, wf))
--
2.51.0
Powered by blists - more mailing lists