Skip to content

Commit

Permalink
rtc: rtc-wm831x: use devm_request_threaded_irq()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jingoo Han authored and Linus Torvalds committed Feb 22, 2013
1 parent 6d77bdc commit fd5231c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/rtc/rtc-wm831x.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,10 @@ static int wm831x_rtc_probe(struct platform_device *pdev)
goto err;
}

ret = request_threaded_irq(alm_irq, NULL, wm831x_alm_irq,
IRQF_TRIGGER_RISING, "RTC alarm",
wm831x_rtc);
ret = devm_request_threaded_irq(&pdev->dev, alm_irq, NULL,
wm831x_alm_irq,
IRQF_TRIGGER_RISING, "RTC alarm",
wm831x_rtc);
if (ret != 0) {
dev_err(&pdev->dev, "Failed to request alarm IRQ %d: %d\n",
alm_irq, ret);
Expand All @@ -462,9 +463,7 @@ static int wm831x_rtc_probe(struct platform_device *pdev)
static int wm831x_rtc_remove(struct platform_device *pdev)
{
struct wm831x_rtc *wm831x_rtc = platform_get_drvdata(pdev);
int alm_irq = platform_get_irq_byname(pdev, "ALM");

free_irq(alm_irq, wm831x_rtc);
rtc_device_unregister(wm831x_rtc->rtc);

return 0;
Expand Down

0 comments on commit fd5231c

Please sign in to comment.