diff options
Diffstat (limited to 'drivers/rtc/rtc-at32ap700x.c')
-rw-r--r-- | drivers/rtc/rtc-at32ap700x.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-at32ap700x.c b/drivers/rtc/rtc-at32ap700x.c index e1ec33e40e38..8825695777df 100644 --- a/drivers/rtc/rtc-at32ap700x.c +++ b/drivers/rtc/rtc-at32ap700x.c | |||
@@ -256,6 +256,8 @@ static int __init at32_rtc_probe(struct platform_device *pdev) | |||
256 | goto out_iounmap; | 256 | goto out_iounmap; |
257 | } | 257 | } |
258 | 258 | ||
259 | platform_set_drvdata(pdev, rtc); | ||
260 | |||
259 | rtc->rtc = rtc_device_register(pdev->name, &pdev->dev, | 261 | rtc->rtc = rtc_device_register(pdev->name, &pdev->dev, |
260 | &at32_rtc_ops, THIS_MODULE); | 262 | &at32_rtc_ops, THIS_MODULE); |
261 | if (IS_ERR(rtc->rtc)) { | 263 | if (IS_ERR(rtc->rtc)) { |
@@ -264,7 +266,6 @@ static int __init at32_rtc_probe(struct platform_device *pdev) | |||
264 | goto out_free_irq; | 266 | goto out_free_irq; |
265 | } | 267 | } |
266 | 268 | ||
267 | platform_set_drvdata(pdev, rtc); | ||
268 | device_init_wakeup(&pdev->dev, 1); | 269 | device_init_wakeup(&pdev->dev, 1); |
269 | 270 | ||
270 | dev_info(&pdev->dev, "Atmel RTC for AT32AP700x at %08lx irq %ld\n", | 271 | dev_info(&pdev->dev, "Atmel RTC for AT32AP700x at %08lx irq %ld\n", |
@@ -273,6 +274,7 @@ static int __init at32_rtc_probe(struct platform_device *pdev) | |||
273 | return 0; | 274 | return 0; |
274 | 275 | ||
275 | out_free_irq: | 276 | out_free_irq: |
277 | platform_set_drvdata(pdev, NULL); | ||
276 | free_irq(irq, rtc); | 278 | free_irq(irq, rtc); |
277 | out_iounmap: | 279 | out_iounmap: |
278 | iounmap(rtc->regs); | 280 | iounmap(rtc->regs); |