rtc: rtc-lp8788: use devm_request_threaded_irq()
authorJingoo Han <jg1.han@samsung.com>
Fri, 22 Feb 2013 00:45:39 +0000 (16:45 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 22 Feb 2013 01:22:30 +0000 (17:22 -0800)
Use devm_request_threaded_irq() to make cleanup paths more simple.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rtc/rtc-lp8788.c

index 4a4e78e2231c25605ca3ea8cc39212eeb1eb67d4..9a4631218f41dd7364c5ca332f9ac29456c1791d 100644 (file)
@@ -278,16 +278,11 @@ static int lp8788_alarm_irq_register(struct platform_device *pdev,
 
        rtc->irq = irq_create_mapping(irqdm, irq);
 
-       return request_threaded_irq(rtc->irq, NULL, lp8788_alarm_irq_handler,
+       return devm_request_threaded_irq(&pdev->dev, rtc->irq, NULL,
+                               lp8788_alarm_irq_handler,
                                0, LP8788_ALM_IRQ, rtc);
 }
 
-static void lp8788_alarm_irq_unregister(struct lp8788_rtc *rtc)
-{
-       if (rtc->irq)
-               free_irq(rtc->irq, rtc);
-}
-
 static int lp8788_rtc_probe(struct platform_device *pdev)
 {
        struct lp8788 *lp = dev_get_drvdata(pdev->dev.parent);
@@ -321,7 +316,6 @@ static int lp8788_rtc_remove(struct platform_device *pdev)
 {
        struct lp8788_rtc *rtc = platform_get_drvdata(pdev);
 
-       lp8788_alarm_irq_unregister(rtc);
        rtc_device_unregister(rtc->rdev);
        platform_set_drvdata(pdev, NULL);