drivers/rtc/rtc-palmas.c: init wakeup before device register
authorWei Ni <[email protected]>
Wed, 3 Jul 2013 22:08:00 +0000 (15:08 -0700)
committerLinus Torvalds <[email protected]>
Wed, 3 Jul 2013 23:08:00 +0000 (16:08 -0700)
Enable dev as wakeup device before calling rtc_device_register(), so that
it can create the "wakealarm" sysfs.

Signed-off-by: Wei Ni <[email protected]>
Acked-by: Laxman Dewangan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/rtc/rtc-palmas.c

index 50204d474eb7f76526cec457b5ca86d69ed248f4..a1fecc8d97fc5e0f30f3c06b8e3d00b466289420 100644 (file)
@@ -265,6 +265,7 @@ static int palmas_rtc_probe(struct platform_device *pdev)
 
        palmas_rtc->irq = platform_get_irq(pdev, 0);
 
+       device_init_wakeup(&pdev->dev, 1);
        palmas_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
                                &palmas_rtc_ops, THIS_MODULE);
        if (IS_ERR(palmas_rtc->rtc)) {
@@ -283,7 +284,6 @@ static int palmas_rtc_probe(struct platform_device *pdev)
                return ret;
        }
 
-       device_set_wakeup_capable(&pdev->dev, 1);
        return 0;
 }