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

index aab4e8c936226244b25f112a52a86c0a84c67a9c..b6aab9f80f737ae95d744e8e1f215e960ac49142 100644 (file)
@@ -274,7 +274,7 @@ static int tps6586x_rtc_probe(struct platform_device *pdev)
        }
 
        platform_set_drvdata(pdev, rtc);
-       rtc->rtc = rtc_device_register(dev_name(&pdev->dev), &pdev->dev,
+       rtc->rtc = devm_rtc_device_register(&pdev->dev, dev_name(&pdev->dev),
                                       &tps6586x_rtc_ops, THIS_MODULE);
        if (IS_ERR(rtc->rtc)) {
                ret = PTR_ERR(rtc->rtc);
@@ -306,12 +306,10 @@ fail_rtc_register:
 
 static int tps6586x_rtc_remove(struct platform_device *pdev)
 {
-       struct tps6586x_rtc *rtc = platform_get_drvdata(pdev);
        struct device *tps_dev = to_tps6586x_dev(&pdev->dev);
 
        tps6586x_update(tps_dev, RTC_CTRL, 0,
                RTC_ENABLE | OSC_SRC_SEL | PRE_BYPASS | CL_SEL_MASK);
-       rtc_device_unregister(rtc->rtc);
        return 0;
 }