* [PATCH] thermal: ti-soc-thermal: Add check for clk_enable()
@ 2024-12-07 4:07 Mingwei Zheng
0 siblings, 0 replies; only message in thread
From: Mingwei Zheng @ 2024-12-07 4:07 UTC (permalink / raw)
To: edubezval, j-keerthy, rafael, daniel.lezcano, rui.zhang,
lukasz.luba, aford173
Cc: linux-pm, linux-omap, linux-kernel, Mingwei Zheng, Jiasheng Jiang
Add check for the return value of clk_enable() to catch the potential
error.
Fixes: 5093402e5b44 ("thermal: ti-soc-thermal: Enable addition power management")
Signed-off-by: Mingwei Zheng <zmw12306@gmail.com>
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
---
drivers/thermal/ti-soc-thermal/ti-bandgap.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index ba43399d0b38..da3e5dec8709 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -1189,6 +1189,7 @@ static int bandgap_omap_cpu_notifier(struct notifier_block *nb,
unsigned long cmd, void *v)
{
struct ti_bandgap *bgp;
+ int ret;
bgp = container_of(nb, struct ti_bandgap, nb);
@@ -1206,8 +1207,11 @@ static int bandgap_omap_cpu_notifier(struct notifier_block *nb,
case CPU_CLUSTER_PM_EXIT:
if (bgp->is_suspended)
break;
- if (TI_BANDGAP_HAS(bgp, CLK_CTRL))
- clk_enable(bgp->fclock);
+ if (TI_BANDGAP_HAS(bgp, CLK_CTRL)) {
+ ret = clk_enable(bgp->fclock);
+ if (ret)
+ return NOTIFY_BAD;
+ }
ti_bandgap_power(bgp, true);
ti_bandgap_restore_ctxt(bgp);
break;
--
2.34.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-12-07 4:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-07 4:07 [PATCH] thermal: ti-soc-thermal: Add check for clk_enable() Mingwei Zheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®