From: Simon Guinot Date: Thu, 3 Apr 2014 21:49:54 +0000 (-0700) Subject: drivers/rtc/rtc-ds1307.c: fix sysfs wakealarm attribute creation X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5ea735144dd4d2716557ff62dbcc940d62d62208;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drivers/rtc/rtc-ds1307.c: fix sysfs wakealarm attribute creation In order to allow the creation of the sysfs attribute wakealarm, this patch moves the device_set_wakeup_capable() call above the RTC device registration. Signed-off-by: Simon Guinot Cc: Jason Cooper Cc: Andrew Lunn Cc: Gregory Clement Cc: Sebastian Hesselbarth Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index 9e2aad68f96d..f739be96cbc0 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c @@ -927,6 +927,7 @@ read_rtc: bin2bcd(tmp)); } + device_set_wakeup_capable(&client->dev, want_irq); ds1307->rtc = devm_rtc_device_register(&client->dev, client->name, &ds13xx_rtc_ops, THIS_MODULE); if (IS_ERR(ds1307->rtc)) { @@ -941,7 +942,6 @@ read_rtc: dev_err(&client->dev, "unable to request IRQ!\n"); } else { - device_set_wakeup_capable(&client->dev, 1); set_bit(HAS_ALARM, &ds1307->flags); dev_dbg(&client->dev, "got IRQ %d\n", client->irq); }