Skip to content

Commit 7ecd9a3

Browse files
jhovoldtorvalds
authored andcommitted
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: 1d2e2b6 ("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>
1 parent 44c63a5 commit 7ecd9a3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎drivers/rtc/rtc-omap.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,8 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
416416
rtc_writel(KICK1_VALUE, OMAP_RTC_KICK1_REG);
417417
}
418418

419+
device_init_wakeup(&pdev->dev, true);
420+
419421
rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
420422
&omap_rtc_ops, THIS_MODULE);
421423
if (IS_ERR(rtc)) {
@@ -484,8 +486,6 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
484486
* is write-only, and always reads as zero...)
485487
*/
486488

487-
device_init_wakeup(&pdev->dev, true);
488-
489489
if (new_ctrl & (u8) OMAP_RTC_CTRL_SPLIT)
490490
pr_info("%s: split power mode\n", pdev->name);
491491

@@ -495,6 +495,7 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
495495
return 0;
496496

497497
fail0:
498+
device_init_wakeup(&pdev->dev, false);
498499
if (id_entry->driver_data & OMAP_RTC_HAS_KICKER)
499500
rtc_writel(0, OMAP_RTC_KICK0_REG);
500501
pm_runtime_put_sync(&pdev->dev);

0 commit comments

Comments
 (0)