Skip to contentSkip to conversation

drivers/rtc/rtc-twl.c: fix: rtcX/wakealarm attribute isn't created

PATCH New Grygorii Strashko 1 participant 1 message Jul 23, 2013 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

CC Kevin Hilman <[email protected]>
CC Tony Lindgren <[email protected]>
---
 drivers/rtc/rtc-twl.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/rtc/rtc-twl.c +2 -1
index 02faf3c..c2e80d7 100644
@@ -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:
Signature · 1 line
1.7.9.5