rtc: mt6397: enable wakeup before registering rtc device
authorWei-Ning Huang <[email protected]>
Thu, 2 Jul 2015 08:36:56 +0000 (16:36 +0800)
committerAlexandre Belloni <[email protected]>
Fri, 17 Jul 2015 22:42:15 +0000 (00:42 +0200)
rtc_sysfs_add_device checks if device can wakeup before creating the
wakealarm file in sysfs. Thus the driver must set wakeup capability
before registering the rtc device.

Signed-off-by: Wei-Ning Huang <[email protected]>
Acked-by: Eddie Huang <[email protected]>
Signed-off-by: Alexandre Belloni <[email protected]>
drivers/rtc/rtc-mt6397.c

index c0090b698ff363732b2e1b0a727de001bc6c26a6..eab230be5a54fdfcfd9c41f39e0d9f1cb515a9e4 100644 (file)
@@ -343,6 +343,8 @@ static int mtk_rtc_probe(struct platform_device *pdev)
                goto out_dispose_irq;
        }
 
+       device_init_wakeup(&pdev->dev, 1);
+
        rtc->rtc_dev = rtc_device_register("mt6397-rtc", &pdev->dev,
                                           &mtk_rtc_ops, THIS_MODULE);
        if (IS_ERR(rtc->rtc_dev)) {
@@ -351,8 +353,6 @@ static int mtk_rtc_probe(struct platform_device *pdev)
                goto out_free_irq;
        }
 
-       device_init_wakeup(&pdev->dev, 1);
-
        return 0;
 
 out_free_irq: