]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rtc: rtc-imxdi: use devm_rtc_device_register()
authorJingoo Han <jg1.han@samsung.com>
Tue, 26 Mar 2013 23:25:24 +0000 (10:25 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 4 Apr 2013 06:12:39 +0000 (17:12 +1100)
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>
drivers/rtc/rtc-imxdi.c

index a5a143ebdd69cb718658e717e0d6ea5601254ab1..d3a8c8e255de9213716d6cca17c56daea2a5b156 100644 (file)
@@ -464,7 +464,7 @@ static int __init dryice_rtc_probe(struct platform_device *pdev)
        }
 
        platform_set_drvdata(pdev, imxdi);
-       imxdi->rtc = rtc_device_register(pdev->name, &pdev->dev,
+       imxdi->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
                                  &dryice_rtc_ops, THIS_MODULE);
        if (IS_ERR(imxdi->rtc)) {
                rc = PTR_ERR(imxdi->rtc);
@@ -488,8 +488,6 @@ static int __exit dryice_rtc_remove(struct platform_device *pdev)
        /* mask all interrupts */
        __raw_writel(0, imxdi->ioaddr + DIER);
 
-       rtc_device_unregister(imxdi->rtc);
-
        clk_disable_unprepare(imxdi->clk);
 
        return 0;