Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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@gmail.com>
Link: https://lore.kernel.org/r/20250902130348.2630053-1-colin.i.king@gmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>

authored by

Colin Ian King and committed by
Uwe Kleine-König
afe87227 3a4b9d02

+1 -1
+1 -1
drivers/pwm/core.c
··· 276 276 277 277 if (IS_ENABLED(CONFIG_PWM_DEBUG) && ret_fromhw > 0) 278 278 dev_err(&chip->dev, "Unexpected return value from __pwm_round_waveform_fromhw: requested %llu/%llu [+%llu], return value %d\n", 279 - wf_req.duty_length_ns, wf_req.period_length_ns, wf_req.duty_offset_ns, ret_tohw); 279 + wf_req.duty_length_ns, wf_req.period_length_ns, wf_req.duty_offset_ns, ret_fromhw); 280 280 281 281 if (IS_ENABLED(CONFIG_PWM_DEBUG) && 282 282 (ret_tohw == 0) != pwm_check_rounding(&wf_req, wf))