[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240510090059.2126666-1-nichen@iscas.ac.cn>
Date: Fri, 10 May 2024 17:00:59 +0800
From: Chen Ni <nichen@...as.ac.cn>
To: vigneshr@...com,
	jpanis@...libre.com,
	wbg@...nel.org
Cc: linux-iio@...r.kernel.org,
	linux-omap@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Chen Ni <nichen@...as.ac.cn>
Subject: [PATCH] counter: ti-ecap-capture: Handle error for clk_enable
As the potential failure of the clk_enable(), it should be better to
check it and return error if fails.
Signed-off-by: Chen Ni <nichen@...as.ac.cn>
---
 drivers/counter/ti-ecap-capture.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/counter/ti-ecap-capture.c b/drivers/counter/ti-ecap-capture.c
index 675447315caf..30a269fa5da0 100644
--- a/drivers/counter/ti-ecap-capture.c
+++ b/drivers/counter/ti-ecap-capture.c
@@ -574,8 +574,11 @@ static int ecap_cnt_resume(struct device *dev)
 {
 	struct counter_device *counter_dev = dev_get_drvdata(dev);
 	struct ecap_cnt_dev *ecap_dev = counter_priv(counter_dev);
+	int ret;
 
-	clk_enable(ecap_dev->clk);
+	ret = clk_enable(ecap_dev->clk);
+	if (ret)
+		return ret;
 
 	ecap_cnt_capture_set_evmode(counter_dev, ecap_dev->pm_ctx.ev_mode);
 
-- 
2.25.1
Powered by blists - more mailing lists