Skip to content

Commit

Permalink
rtc: rtc-max8997: 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 83a72c8 commit c1879fe
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/rtc/rtc-max8997.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,8 @@ static int max8997_rtc_probe(struct platform_device *pdev)
}
info->virq = virq;

ret = request_threaded_irq(virq, NULL, max8997_rtc_alarm_irq, 0,
ret = devm_request_threaded_irq(&pdev->dev, virq, NULL,
max8997_rtc_alarm_irq, 0,
"rtc-alarm0", info);
if (ret < 0) {
dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n",
Expand All @@ -514,10 +515,8 @@ static int max8997_rtc_remove(struct platform_device *pdev)
{
struct max8997_rtc_info *info = platform_get_drvdata(pdev);

if (info) {
free_irq(info->virq, info);
if (info)
rtc_device_unregister(info->rtc_dev);
}

return 0;
}
Expand Down

0 comments on commit c1879fe

Please sign in to comment.