]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rtc: rtc-davinci: remove unnecessary platform_set_drvdata()
authorJingoo Han <jg1.han@samsung.com>
Thu, 27 Jun 2013 23:53:10 +0000 (09:53 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Jun 2013 06:38:31 +0000 (16:38 +1000)
The driver core clears the driver data to NULL after device_release or on
probe failure, since commit 0998d063100 ("device-core: Ensure drvdata =
NULL when no driver is bound").  Thus, it is not needed to manually clear
the device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/rtc/rtc-davinci.c

index be5fc32d3cd742b8a7ab753e951147d998dd9b0e..24677ef8c39ad37b9d920862242f0b245337de18 100644 (file)
@@ -526,10 +526,9 @@ static int __init davinci_rtc_probe(struct platform_device *pdev)
        davinci_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
                                    &davinci_rtc_ops, THIS_MODULE);
        if (IS_ERR(davinci_rtc->rtc)) {
-               ret = PTR_ERR(davinci_rtc->rtc);
                dev_err(dev, "unable to register RTC device, err %d\n",
                                ret);
-               goto fail1;
+               return PTR_ERR(davinci_rtc->rtc);
        }
 
        rtcif_write(davinci_rtc, PRTCIF_INTFLG_RTCSS, PRTCIF_INTFLG);
@@ -543,7 +542,7 @@ static int __init davinci_rtc_probe(struct platform_device *pdev)
                          0, "davinci_rtc", davinci_rtc);
        if (ret < 0) {
                dev_err(dev, "unable to register davinci RTC interrupt\n");
-               goto fail1;
+               return ret;
        }
 
        /* Enable interrupts */
@@ -556,10 +555,6 @@ static int __init davinci_rtc_probe(struct platform_device *pdev)
        device_init_wakeup(&pdev->dev, 0);
 
        return 0;
-
-fail1:
-       platform_set_drvdata(pdev, NULL);
-       return ret;
 }
 
 static int __exit davinci_rtc_remove(struct platform_device *pdev)
@@ -570,8 +565,6 @@ static int __exit davinci_rtc_remove(struct platform_device *pdev)
 
        rtcif_write(davinci_rtc, 0, PRTCIF_INTEN);
 
-       platform_set_drvdata(pdev, NULL);
-
        return 0;
 }