aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/pwm/pwm-stm32.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-04-17 12:23:49 -0700
committerJakub Kicinski <kuba@kernel.org>2025-04-17 12:26:50 -0700
commit240ce924d2718b8f6f622f2a9a9c219b9da736e8 (patch)
treea417bc3d31264e2c317614b25c4a7a6f688916b5 /drivers/pwm/pwm-stm32.c
parentMerge branch 'net-pktgen-fix-checkpatch-code-style-errors-warnings' (diff)
parentMerge tag 'net-6.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net (diff)
downloadwireguard-linux-240ce924d2718b8f6f622f2a9a9c219b9da736e8.tar.xz
wireguard-linux-240ce924d2718b8f6f622f2a9a9c219b9da736e8.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR (net-6.15-rc3). No conflicts. Adjacent changes: tools/net/ynl/pyynl/ynl_gen_c.py 4d07bbf2d456 ("tools: ynl-gen: don't declare loop iterator in place") 7e8ba0c7de2b ("tools: ynl: don't use genlmsghdr in classic netlink") Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/pwm/pwm-stm32.c')
-rw-r--r--drivers/pwm/pwm-stm32.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c
index a59de4de18b6..ec2c05c9ee7a 100644
--- a/drivers/pwm/pwm-stm32.c
+++ b/drivers/pwm/pwm-stm32.c
@@ -103,22 +103,16 @@ static int stm32_pwm_round_waveform_tohw(struct pwm_chip *chip,
if (ret)
goto out;
- /*
- * calculate the best value for ARR for the given PSC, refuse if
- * the resulting period gets bigger than the requested one.
- */
arr = mul_u64_u64_div_u64(wf->period_length_ns, rate,
(u64)NSEC_PER_SEC * (wfhw->psc + 1));
if (arr <= wfhw->arr) {
/*
- * requested period is small than the currently
+ * requested period is smaller than the currently
* configured and unchangable period, report back the smallest
- * possible period, i.e. the current state; Initialize
- * ccr to anything valid.
+ * possible period, i.e. the current state and return 1
+ * to indicate the wrong rounding direction.
*/
- wfhw->ccr = 0;
ret = 1;
- goto out;
}
} else {