Skip to content

Commit

Permalink
drivers/rtc/rtc-twl.c: fix: rtcX/wakealarm attribute isn't created
Browse files Browse the repository at this point in the history
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 <grygorii.strashko@ti.com>
Cc: Kevin Hilman <khilman@linaro.org>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Grygorii Strashko authored and Linus Torvalds committed Jul 31, 2013
1 parent 9d8c5b5 commit b99b94b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/rtc/rtc-twl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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:
Expand Down

0 comments on commit b99b94b

Please sign in to comment.