rtc: Add check for clk_enable()
PATCH 1/1 rtc: Add check for clk_enable()
Add check for the return value of clk_enable() to catch the potential error.
Fixes 0c4eae66591a ("rtc: convert drivers/rtc/* to use module_platform_driver()")
Signed-off-by Mingwei Zheng <[email protected]>
Signed-off-by Jiasheng Jiang <[email protected]>
--- drivers/rtc/rtc-spear.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/rtc/rtc-spear.c +4 -2
@@ -437,7 +437,7 @@ static int spear_rtc_resume(struct device *dev) {struct platform_device *pdev =to_platform_device (dev);struct spear_rtc_config *config =platform_get_drvdata (pdev); -int irq; +int irq, ret; irq =platform_get_irq (pdev,0 );
@@ -447,7 +447,9 @@ static int spear_rtc_resume(struct device *dev) config->irq_wake =0 ; } }else { -clk_enable (config->clk); + ret =clk_enable (config->clk); +if (ret) +return ret;spear_rtc_enable_interrupt (config); }
Signature · 1 line
2.34.1