[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20241215222824.147575-1-zmw12306@gmail.com>
Date: Sun, 15 Dec 2024 17:28:24 -0500
From: Mingwei Zheng <zmw12306@...il.com>
To: alexandre.belloni@...tlin.com,
anson.huang@....com
Cc: linux-rtc@...r.kernel.org,
linux-kernel@...r.kernel.org,
Mingwei Zheng <zmw12306@...il.com>,
Jiasheng Jiang <jiashengjiangcool@...il.com>
Subject: [PATCH] rtc: snvs: Add check for clk_enable()
Add check for the return value of clk_enable() to catch the potential
error.
Fixes: edb190cb1734 ("rtc: snvs: make sure clock is enabled for interrupt handle")
Signed-off-by: Mingwei Zheng <zmw12306@...il.com>
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@...il.com>
---
drivers/rtc/rtc-snvs.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-snvs.c b/drivers/rtc/rtc-snvs.c
index d82acf1af1fa..62af750e5751 100644
--- a/drivers/rtc/rtc-snvs.c
+++ b/drivers/rtc/rtc-snvs.c
@@ -281,8 +281,11 @@ static irqreturn_t snvs_rtc_irq_handler(int irq, void *dev_id)
struct snvs_rtc_data *data = dev_get_drvdata(dev);
u32 lpsr;
u32 events = 0;
+ int ret;
- clk_enable(data->clk);
+ ret = clk_enable(data->clk);
+ if (ret)
+ return IRQ_NONE;
regmap_read(data->regmap, data->offset + SNVS_LPSR, &lpsr);
--
2.34.1
Powered by blists - more mailing lists