projects
/
linux-2.6-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
78dcad6
)
pwm: stm32: Add check for clk_enable()
author
Mingwei Zheng
<zmw12306@gmail.com>
Sun, 15 Dec 2024 22:47:52 +0000
(17:47 -0500)
committer
Uwe Kleine-König
<ukleinek@kernel.org>
Fri, 17 Jan 2025 09:41:56 +0000
(10:41 +0100)
Add check for the return value of clk_enable() to catch the potential
error.
Fixes:
19f1016ea960
("pwm: stm32: Fix enable count for clk in .probe()")
Signed-off-by: Mingwei Zheng <zmw12306@gmail.com>
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Link:
https://lore.kernel.org/r/20241215224752.220318-1-zmw12306@gmail.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
drivers/pwm/pwm-stm32.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/pwm/pwm-stm32.c
b/drivers/pwm/pwm-stm32.c
index 17e591f61efb6031b6c47e25c88d252377d0094a..a59de4de18b6e9a06de5afd952241c1844ab149a 100644
(file)
--- a/
drivers/pwm/pwm-stm32.c
+++ b/
drivers/pwm/pwm-stm32.c
@@
-858,8
+858,11
@@
static int stm32_pwm_probe(struct platform_device *pdev)
chip->ops = &stm32pwm_ops;
/* Initialize clock refcount to number of enabled PWM channels. */
- for (i = 0; i < num_enabled; i++)
- clk_enable(priv->clk);
+ for (i = 0; i < num_enabled; i++) {
+ ret = clk_enable(priv->clk);
+ if (ret)
+ return ret;
+ }
ret = devm_pwmchip_add(dev, chip);
if (ret < 0)