Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: rtc-imxdi: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

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>

authored by

Jingoo Han and committed by
Linus Torvalds
04f70e4c 5d65cbfb

+1 -3
+1 -3
drivers/rtc/rtc-imxdi.c
··· 464 464 } 465 465 466 466 platform_set_drvdata(pdev, imxdi); 467 - imxdi->rtc = rtc_device_register(pdev->name, &pdev->dev, 467 + imxdi->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, 468 468 &dryice_rtc_ops, THIS_MODULE); 469 469 if (IS_ERR(imxdi->rtc)) { 470 470 rc = PTR_ERR(imxdi->rtc); ··· 487 487 488 488 /* mask all interrupts */ 489 489 __raw_writel(0, imxdi->ioaddr + DIER); 490 - 491 - rtc_device_unregister(imxdi->rtc); 492 490 493 491 clk_disable_unprepare(imxdi->clk); 494 492