]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rtc: rtc-s3c: use devm_rtc_device_register()
authorJingoo Han <jg1.han@samsung.com>
Sat, 23 Mar 2013 02:32:23 +0000 (13:32 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 26 Mar 2013 05:11:20 +0000 (16:11 +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-s3c.c

index fb994e9ddc156de9a98465531db161202826fe57..7dcf719d9b858e3d81d72b3b7ca8b1899b0c64f8 100644 (file)
@@ -423,10 +423,7 @@ static void s3c_rtc_enable(struct platform_device *pdev, int en)
 
 static int s3c_rtc_remove(struct platform_device *dev)
 {
-       struct rtc_device *rtc = platform_get_drvdata(dev);
-
        platform_set_drvdata(dev, NULL);
-       rtc_device_unregister(rtc);
 
        s3c_rtc_setaie(&dev->dev, 0);
 
@@ -511,7 +508,7 @@ static int s3c_rtc_probe(struct platform_device *pdev)
 
        /* register RTC and exit */
 
-       rtc = rtc_device_register("s3c", &pdev->dev, &s3c_rtcops,
+       rtc = devm_rtc_device_register(&pdev->dev, "s3c", &s3c_rtcops,
                                  THIS_MODULE);
 
        if (IS_ERR(rtc)) {
@@ -574,7 +571,6 @@ static int s3c_rtc_probe(struct platform_device *pdev)
 
  err_alarm_irq:
        platform_set_drvdata(pdev, NULL);
-       rtc_device_unregister(rtc);
 
  err_nortc:
        s3c_rtc_enable(pdev, 0);