Skip to content

Commit

Permalink
rtc: rtc-max8907: 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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Jingoo Han authored and torvalds committed Feb 22, 2013
1 parent 27239a1 commit 83a72c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/rtc/rtc-max8907.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,9 @@ static int max8907_rtc_probe(struct platform_device *pdev)
goto err_unregister;
}

ret = request_threaded_irq(rtc->irq, NULL, max8907_irq_handler,
IRQF_ONESHOT, "max8907-alarm0", rtc);
ret = devm_request_threaded_irq(&pdev->dev, rtc->irq, NULL,
max8907_irq_handler,
IRQF_ONESHOT, "max8907-alarm0", rtc);
if (ret < 0) {
dev_err(&pdev->dev, "Failed to request IRQ%d: %d\n",
rtc->irq, ret);
Expand All @@ -224,7 +225,6 @@ static int max8907_rtc_remove(struct platform_device *pdev)
{
struct max8907_rtc *rtc = platform_get_drvdata(pdev);

free_irq(rtc->irq, rtc);
rtc_device_unregister(rtc->rtc_dev);

return 0;
Expand Down

0 comments on commit 83a72c8

Please sign in to comment.