aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-lp8788.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-02-21 19:45:39 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 20:22:30 -0500
commit14b149ebd252029b41ed432024ee1db1b6afb028 (patch)
tree724719408c5a1a51d8cbd715ff2406c728920d4c /drivers/rtc/rtc-lp8788.c
parent3b759d7f749f09617814587d4f2f448d8432afcb (diff)
rtc: rtc-lp8788: use devm_request_threaded_irq()
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>
Diffstat (limited to 'drivers/rtc/rtc-lp8788.c')
-rw-r--r--drivers/rtc/rtc-lp8788.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-lp8788.c b/drivers/rtc/rtc-lp8788.c
index 4a4e78e2231c..9a4631218f41 100644
--- a/drivers/rtc/rtc-lp8788.c
+++ b/drivers/rtc/rtc-lp8788.c
@@ -278,16 +278,11 @@ static int lp8788_alarm_irq_register(struct platform_device *pdev,
278 278
279 rtc->irq = irq_create_mapping(irqdm, irq); 279 rtc->irq = irq_create_mapping(irqdm, irq);
280 280
281 return request_threaded_irq(rtc->irq, NULL, lp8788_alarm_irq_handler, 281 return devm_request_threaded_irq(&pdev->dev, rtc->irq, NULL,
282 lp8788_alarm_irq_handler,
282 0, LP8788_ALM_IRQ, rtc); 283 0, LP8788_ALM_IRQ, rtc);
283} 284}
284 285
285static void lp8788_alarm_irq_unregister(struct lp8788_rtc *rtc)
286{
287 if (rtc->irq)
288 free_irq(rtc->irq, rtc);
289}
290
291static int lp8788_rtc_probe(struct platform_device *pdev) 286static int lp8788_rtc_probe(struct platform_device *pdev)
292{ 287{
293 struct lp8788 *lp = dev_get_drvdata(pdev->dev.parent); 288 struct lp8788 *lp = dev_get_drvdata(pdev->dev.parent);
@@ -321,7 +316,6 @@ static int lp8788_rtc_remove(struct platform_device *pdev)
321{ 316{
322 struct lp8788_rtc *rtc = platform_get_drvdata(pdev); 317 struct lp8788_rtc *rtc = platform_get_drvdata(pdev);
323 318
324 lp8788_alarm_irq_unregister(rtc);
325 rtc_device_unregister(rtc->rdev); 319 rtc_device_unregister(rtc->rdev);
326 platform_set_drvdata(pdev, NULL); 320 platform_set_drvdata(pdev, NULL);
327 321