]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rtc: rtc-rc5t583: use devm_rtc_device_register()
authorJingoo Han <jg1.han@samsung.com>
Wed, 20 Mar 2013 04:08:18 +0000 (15:08 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 21 Mar 2013 05:34:21 +0000 (16:34 +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-rc5t583.c

index eb3194d664a8b7c03b378701a9840e3024bc6ad8..518908d9d6aa50c1856155c2434e886b4fe31e7c 100644 (file)
@@ -256,7 +256,7 @@ static int rc5t583_rtc_probe(struct platform_device *pdev)
        }
        device_init_wakeup(&pdev->dev, 1);
 
-       ricoh_rtc->rtc = rtc_device_register(pdev->name, &pdev->dev,
+       ricoh_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
                &rc5t583_rtc_ops, THIS_MODULE);
        if (IS_ERR(ricoh_rtc->rtc)) {
                ret = PTR_ERR(ricoh_rtc->rtc);
@@ -276,8 +276,6 @@ static int rc5t583_rtc_remove(struct platform_device *pdev)
        struct rc5t583_rtc *rc5t583_rtc = dev_get_drvdata(&pdev->dev);
 
        rc5t583_rtc_alarm_irq_enable(&rc5t583_rtc->rtc->dev, 0);
-
-       rtc_device_unregister(rc5t583_rtc->rtc);
        return 0;
 }