rtc: pm8xxx: move device_init_wakeup() before rtc_register
authorJosh Cartwright <joshc@codeaurora.org>
Thu, 3 Apr 2014 21:50:14 +0000 (14:50 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 3 Apr 2014 23:21:23 +0000 (16:21 -0700)
Setup wakeup capability before rtc_register to ensure the rtc class core
properly sets up our 'wakealarm' sysfs attribute.

Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rtc/rtc-pm8xxx.c

index 6e3cd345379d7624bcce026c75d2cd4a8b2a5f98..197699f358c7c18456d9ff7ab8130700001507a7 100644 (file)
@@ -429,6 +429,8 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, rtc_dd);
 
+       device_init_wakeup(&pdev->dev, 1);
+
        /* Register the RTC device */
        rtc_dd->rtc = devm_rtc_device_register(&pdev->dev, "pm8xxx_rtc",
                                               &pm8xxx_rtc_ops, THIS_MODULE);
@@ -448,8 +450,6 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev)
                return rc;
        }
 
-       device_init_wakeup(&pdev->dev, 1);
-
        dev_dbg(&pdev->dev, "Probe success !!\n");
 
        return 0;