From: Grygorii Strashko Date: Wed, 31 Jul 2013 20:53:41 +0000 (-0700) Subject: drivers/rtc/rtc-twl.c: fix: rtcX/wakealarm attribute isn't created X-Git-Tag: upstream/snapshot3+hdmi~4619^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b99b94b52339dc186810e29f1f6472d86c42d2d9;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git drivers/rtc/rtc-twl.c: fix: rtcX/wakealarm attribute isn't created The device_init_wakeup() should be called before rtc_device_register(). Otherwise, sysfs "sys/class/rtc/rtcX/wakealarm" attribute will not be seen from User space. Signed-off-by: Grygorii Strashko Cc: Kevin Hilman Cc: Tony Lindgren Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c index 02faf3c..c2e80d7 100644 --- a/drivers/rtc/rtc-twl.c +++ b/drivers/rtc/rtc-twl.c @@ -524,6 +524,8 @@ static int twl_rtc_probe(struct platform_device *pdev) if (ret < 0) goto out1; + device_init_wakeup(&pdev->dev, 1); + rtc = rtc_device_register(pdev->name, &pdev->dev, &twl_rtc_ops, THIS_MODULE); if (IS_ERR(rtc)) { @@ -542,7 +544,6 @@ static int twl_rtc_probe(struct platform_device *pdev) } platform_set_drvdata(pdev, rtc); - device_init_wakeup(&pdev->dev, 1); return 0; out2: