aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2014-12-10 18:52:33 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 20:41:13 -0500
commit7ecd9a3f062147400e605713724dd67dbb7e5053 (patch)
treeed21df946fd837369300ed6dba4425269bbcc71f /drivers/rtc
parent44c63a570aaec3c5d5569d63b7c4a31ddd88cae0 (diff)
rtc: omap: fix missing wakealarm attribute
The platform device must be registered as wakeup capable before registering the class device, or the wakealarm attribute will not be created. Also make sure to unregister the wakeup source on probe errors. Fixes: 1d2e2b65d098 ("rtc: omap: restore back (hard-code) wakeup support") Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Felipe Balbi <balbi@ti.com> Tested-by: Felipe Balbi <balbi@ti.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Tony Lindgren <tony@atomide.com> Cc: Benot Cousson <bcousson@baylibre.com> Cc: Lokesh Vutla <lokeshvutla@ti.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Sekhar Nori <nsekhar@ti.com> Cc: Tero Kristo <t-kristo@ti.com> Cc: Keerthy J <j-keerthy@ti.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-omap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index f842c216f2dd..828cb9983cc2 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -416,6 +416,8 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
416 rtc_writel(KICK1_VALUE, OMAP_RTC_KICK1_REG); 416 rtc_writel(KICK1_VALUE, OMAP_RTC_KICK1_REG);
417 } 417 }
418 418
419 device_init_wakeup(&pdev->dev, true);
420
419 rtc = devm_rtc_device_register(&pdev->dev, pdev->name, 421 rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
420 &omap_rtc_ops, THIS_MODULE); 422 &omap_rtc_ops, THIS_MODULE);
421 if (IS_ERR(rtc)) { 423 if (IS_ERR(rtc)) {
@@ -484,8 +486,6 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
484 * is write-only, and always reads as zero...) 486 * is write-only, and always reads as zero...)
485 */ 487 */
486 488
487 device_init_wakeup(&pdev->dev, true);
488
489 if (new_ctrl & (u8) OMAP_RTC_CTRL_SPLIT) 489 if (new_ctrl & (u8) OMAP_RTC_CTRL_SPLIT)
490 pr_info("%s: split power mode\n", pdev->name); 490 pr_info("%s: split power mode\n", pdev->name);
491 491
@@ -495,6 +495,7 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
495 return 0; 495 return 0;
496 496
497fail0: 497fail0:
498 device_init_wakeup(&pdev->dev, false);
498 if (id_entry->driver_data & OMAP_RTC_HAS_KICKER) 499 if (id_entry->driver_data & OMAP_RTC_HAS_KICKER)
499 rtc_writel(0, OMAP_RTC_KICK0_REG); 500 rtc_writel(0, OMAP_RTC_KICK0_REG);
500 pm_runtime_put_sync(&pdev->dev); 501 pm_runtime_put_sync(&pdev->dev);