diff options
Diffstat (limited to 'drivers/rtc/rtc-nuc900.c')
-rw-r--r-- | drivers/rtc/rtc-nuc900.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/rtc/rtc-nuc900.c b/drivers/rtc/rtc-nuc900.c index 84336d170a38..0267ea3b0f67 100644 --- a/drivers/rtc/rtc-nuc900.c +++ b/drivers/rtc/rtc-nuc900.c | |||
@@ -269,29 +269,30 @@ static int __devinit nuc900_rtc_probe(struct platform_device *pdev) | |||
269 | goto fail2; | 269 | goto fail2; |
270 | } | 270 | } |
271 | 271 | ||
272 | nuc900_rtc->irq_num = platform_get_irq(pdev, 0); | 272 | platform_set_drvdata(pdev, nuc900_rtc); |
273 | if (request_irq(nuc900_rtc->irq_num, nuc900_rtc_interrupt, | ||
274 | IRQF_DISABLED, "nuc900rtc", nuc900_rtc)) { | ||
275 | dev_err(&pdev->dev, "NUC900 RTC request irq failed\n"); | ||
276 | err = -EBUSY; | ||
277 | goto fail3; | ||
278 | } | ||
279 | 273 | ||
280 | nuc900_rtc->rtcdev = rtc_device_register(pdev->name, &pdev->dev, | 274 | nuc900_rtc->rtcdev = rtc_device_register(pdev->name, &pdev->dev, |
281 | &nuc900_rtc_ops, THIS_MODULE); | 275 | &nuc900_rtc_ops, THIS_MODULE); |
282 | if (IS_ERR(nuc900_rtc->rtcdev)) { | 276 | if (IS_ERR(nuc900_rtc->rtcdev)) { |
283 | dev_err(&pdev->dev, "rtc device register faild\n"); | 277 | dev_err(&pdev->dev, "rtc device register faild\n"); |
284 | err = PTR_ERR(nuc900_rtc->rtcdev); | 278 | err = PTR_ERR(nuc900_rtc->rtcdev); |
285 | goto fail4; | 279 | goto fail3; |
286 | } | 280 | } |
287 | 281 | ||
288 | platform_set_drvdata(pdev, nuc900_rtc); | ||
289 | __raw_writel(__raw_readl(nuc900_rtc->rtc_reg + REG_RTC_TSSR) | MODE24, | 282 | __raw_writel(__raw_readl(nuc900_rtc->rtc_reg + REG_RTC_TSSR) | MODE24, |
290 | nuc900_rtc->rtc_reg + REG_RTC_TSSR); | 283 | nuc900_rtc->rtc_reg + REG_RTC_TSSR); |
291 | 284 | ||
285 | nuc900_rtc->irq_num = platform_get_irq(pdev, 0); | ||
286 | if (request_irq(nuc900_rtc->irq_num, nuc900_rtc_interrupt, | ||
287 | IRQF_DISABLED, "nuc900rtc", nuc900_rtc)) { | ||
288 | dev_err(&pdev->dev, "NUC900 RTC request irq failed\n"); | ||
289 | err = -EBUSY; | ||
290 | goto fail4; | ||
291 | } | ||
292 | |||
292 | return 0; | 293 | return 0; |
293 | 294 | ||
294 | fail4: free_irq(nuc900_rtc->irq_num, nuc900_rtc); | 295 | fail4: rtc_device_unregister(nuc900_rtc->rtcdev); |
295 | fail3: iounmap(nuc900_rtc->rtc_reg); | 296 | fail3: iounmap(nuc900_rtc->rtc_reg); |
296 | fail2: release_mem_region(res->start, resource_size(res)); | 297 | fail2: release_mem_region(res->start, resource_size(res)); |
297 | fail1: kfree(nuc900_rtc); | 298 | fail1: kfree(nuc900_rtc); |
@@ -303,8 +304,8 @@ static int __devexit nuc900_rtc_remove(struct platform_device *pdev) | |||
303 | struct nuc900_rtc *nuc900_rtc = platform_get_drvdata(pdev); | 304 | struct nuc900_rtc *nuc900_rtc = platform_get_drvdata(pdev); |
304 | struct resource *res; | 305 | struct resource *res; |
305 | 306 | ||
306 | rtc_device_unregister(nuc900_rtc->rtcdev); | ||
307 | free_irq(nuc900_rtc->irq_num, nuc900_rtc); | 307 | free_irq(nuc900_rtc->irq_num, nuc900_rtc); |
308 | rtc_device_unregister(nuc900_rtc->rtcdev); | ||
308 | iounmap(nuc900_rtc->rtc_reg); | 309 | iounmap(nuc900_rtc->rtc_reg); |
309 | 310 | ||
310 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 311 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |