Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[cascardo/linux.git] / drivers / rtc / rtc-pl031.c
index 0f0609b..99181ff 100644 (file)
@@ -305,7 +305,6 @@ static int pl031_remove(struct amba_device *adev)
 {
        struct pl031_local *ldata = dev_get_drvdata(&adev->dev);
 
-       amba_set_drvdata(adev, NULL);
        free_irq(adev->irq[0], ldata);
        rtc_device_unregister(ldata->rtc);
        iounmap(ldata->base);
@@ -371,6 +370,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
                }
        }
 
+       device_init_wakeup(&adev->dev, 1);
        ldata->rtc = rtc_device_register("pl031", &adev->dev, ops,
                                        THIS_MODULE);
        if (IS_ERR(ldata->rtc)) {
@@ -384,15 +384,12 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
                goto out_no_irq;
        }
 
-       device_init_wakeup(&adev->dev, 1);
-
        return 0;
 
 out_no_irq:
        rtc_device_unregister(ldata->rtc);
 out_no_rtc:
        iounmap(ldata->base);
-       amba_set_drvdata(adev, NULL);
 out_no_remap:
        kfree(ldata);
 out: