diff options
Diffstat (limited to 'drivers/rtc/rtc-omap.c')
-rw-r--r-- | drivers/rtc/rtc-omap.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c index 6b10db5a5702..813bed270867 100644 --- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c | |||
@@ -413,16 +413,6 @@ static int __init omap_rtc_probe(struct platform_device *pdev) | |||
413 | rtc_writel(KICK1_VALUE, OMAP_RTC_KICK1_REG); | 413 | rtc_writel(KICK1_VALUE, OMAP_RTC_KICK1_REG); |
414 | } | 414 | } |
415 | 415 | ||
416 | device_init_wakeup(&pdev->dev, true); | ||
417 | |||
418 | rtc = devm_rtc_device_register(&pdev->dev, pdev->name, | ||
419 | &omap_rtc_ops, THIS_MODULE); | ||
420 | if (IS_ERR(rtc)) { | ||
421 | ret = PTR_ERR(rtc); | ||
422 | goto err; | ||
423 | } | ||
424 | platform_set_drvdata(pdev, rtc); | ||
425 | |||
426 | /* | 416 | /* |
427 | * disable interrupts | 417 | * disable interrupts |
428 | * | 418 | * |
@@ -446,19 +436,6 @@ static int __init omap_rtc_probe(struct platform_device *pdev) | |||
446 | if (reg & (u8) OMAP_RTC_STATUS_ALARM) | 436 | if (reg & (u8) OMAP_RTC_STATUS_ALARM) |
447 | rtc_write(OMAP_RTC_STATUS_ALARM, OMAP_RTC_STATUS_REG); | 437 | rtc_write(OMAP_RTC_STATUS_ALARM, OMAP_RTC_STATUS_REG); |
448 | 438 | ||
449 | /* handle periodic and alarm irqs */ | ||
450 | ret = devm_request_irq(&pdev->dev, omap_rtc_timer, rtc_irq, 0, | ||
451 | dev_name(&rtc->dev), rtc); | ||
452 | if (ret) | ||
453 | goto err; | ||
454 | |||
455 | if (omap_rtc_timer != omap_rtc_alarm) { | ||
456 | ret = devm_request_irq(&pdev->dev, omap_rtc_alarm, rtc_irq, 0, | ||
457 | dev_name(&rtc->dev), rtc); | ||
458 | if (ret) | ||
459 | goto err; | ||
460 | } | ||
461 | |||
462 | /* On boards with split power, RTC_ON_NOFF won't reset the RTC */ | 439 | /* On boards with split power, RTC_ON_NOFF won't reset the RTC */ |
463 | reg = rtc_read(OMAP_RTC_CTRL_REG); | 440 | reg = rtc_read(OMAP_RTC_CTRL_REG); |
464 | if (reg & (u8) OMAP_RTC_CTRL_STOP) | 441 | if (reg & (u8) OMAP_RTC_CTRL_STOP) |
@@ -488,6 +465,29 @@ static int __init omap_rtc_probe(struct platform_device *pdev) | |||
488 | if (reg != new_ctrl) | 465 | if (reg != new_ctrl) |
489 | rtc_write(new_ctrl, OMAP_RTC_CTRL_REG); | 466 | rtc_write(new_ctrl, OMAP_RTC_CTRL_REG); |
490 | 467 | ||
468 | device_init_wakeup(&pdev->dev, true); | ||
469 | |||
470 | rtc = devm_rtc_device_register(&pdev->dev, pdev->name, | ||
471 | &omap_rtc_ops, THIS_MODULE); | ||
472 | if (IS_ERR(rtc)) { | ||
473 | ret = PTR_ERR(rtc); | ||
474 | goto err; | ||
475 | } | ||
476 | platform_set_drvdata(pdev, rtc); | ||
477 | |||
478 | /* handle periodic and alarm irqs */ | ||
479 | ret = devm_request_irq(&pdev->dev, omap_rtc_timer, rtc_irq, 0, | ||
480 | dev_name(&rtc->dev), rtc); | ||
481 | if (ret) | ||
482 | goto err; | ||
483 | |||
484 | if (omap_rtc_timer != omap_rtc_alarm) { | ||
485 | ret = devm_request_irq(&pdev->dev, omap_rtc_alarm, rtc_irq, 0, | ||
486 | dev_name(&rtc->dev), rtc); | ||
487 | if (ret) | ||
488 | goto err; | ||
489 | } | ||
490 | |||
491 | return 0; | 491 | return 0; |
492 | 492 | ||
493 | err: | 493 | err: |