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>
 
        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