]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
rtc: mt6397: drop free_irq of devm_ allocated irq
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 13 Nov 2019 02:17:20 +0000 (02:17 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Feb 2020 21:53:00 +0000 (16:53 -0500)
commit 751438bc0f10f75633144acd6ff145f7260706d5 upstream.

The devm_request_threaded_irq function allocates irq that is
released when a driver detaches. Thus, there is no reason to
explicitly call free_irq in probe function.

Fixes: 851b87148aa2 ("rtc: mt6397: improvements of rtc driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20191113021720.9527-1-weiyongjun1@huawei.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/rtc/rtc-mt6397.c

index 9135e21017523959d257484f272b493232bb7b28..cda238dfe69b6ed29c9eea4f53cccc639e75a537 100644 (file)
@@ -297,15 +297,7 @@ static int mtk_rtc_probe(struct platform_device *pdev)
 
        rtc->rtc_dev->ops = &mtk_rtc_ops;
 
-       ret = rtc_register_device(rtc->rtc_dev);
-       if (ret)
-               goto out_free_irq;
-
-       return 0;
-
-out_free_irq:
-       free_irq(rtc->irq, rtc);
-       return ret;
+       return rtc_register_device(rtc->rtc_dev);
 }
 
 #ifdef CONFIG_PM_SLEEP