summaryrefslogtreecommitdiffstats
path: root/drivers/counter
diff options
context:
space:
mode:
authorJiasheng Jiang <jiashengjiangcool@gmail.com>2024-11-04 20:40:59 +0100
committerWilliam Breathitt Gray <wbg@kernel.org>2024-11-05 01:20:11 +0100
commit1437d9f1c56fce9c24e566508bce1d218dd5497a (patch)
tree63f4fa92b096e5845056716f02d24748771ccb1b /drivers/counter
parentcounter: stm32-timer-cnt: Add check for clk_enable() (diff)
downloadlinux-1437d9f1c56fce9c24e566508bce1d218dd5497a.tar.xz
linux-1437d9f1c56fce9c24e566508bce1d218dd5497a.zip
counter: ti-ecap-capture: Add check for clk_enable()
Add check for the return value of clk_enable() in order to catch the potential exception. Fixes: 4e2f42aa00b6 ("counter: ti-ecap-capture: capture driver support for ECAP") Reviewed-by: Julien Panis <jpanis@baylibre.com> Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com> Link: https://lore.kernel.org/r/20241104194059.47924-1-jiashengjiangcool@gmail.com Signed-off-by: William Breathitt Gray <wbg@kernel.org>
Diffstat (limited to 'drivers/counter')
-rw-r--r--drivers/counter/ti-ecap-capture.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/counter/ti-ecap-capture.c b/drivers/counter/ti-ecap-capture.c
index 675447315caf..b119aeede693 100644
--- a/drivers/counter/ti-ecap-capture.c
+++ b/drivers/counter/ti-ecap-capture.c
@@ -574,8 +574,13 @@ 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) {
+ dev_err(dev, "Cannot enable clock %d\n", ret);
+ return ret;
+ }
ecap_cnt_capture_set_evmode(counter_dev, ecap_dev->pm_ctx.ev_mode);