Skip to content

Commit c1879fe

Browse files
Jingoo Hantorvalds
authored andcommitted
rtc: rtc-max8997: 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>
1 parent 83a72c8 commit c1879fe

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/rtc/rtc-max8997.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,8 @@ static int max8997_rtc_probe(struct platform_device *pdev)
495495
}
496496
info->virq = virq;
497497

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

517-
if (info) {
518-
free_irq(info->virq, info);
518+
if (info)
519519
rtc_device_unregister(info->rtc_dev);
520-
}
521520

522521
return 0;
523522
}

0 commit comments

Comments
 (0)