]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: ds3232: Call device_init_wakeup before device_register
authorPhil Reid <preid@electromag.com.au>
Fri, 24 Feb 2017 03:12:51 +0000 (11:12 +0800)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Fri, 24 Feb 2017 10:14:53 +0000 (11:14 +0100)
commit2e132de670e083ff3593b22ea17d0bf17529ac20
tree38de5b6128eab750323809c445502701ca1d0ebc
parent59b29c64972235061f56738ba57481abb5c0c68d
rtc: ds3232: Call device_init_wakeup before device_register

The wakealarm attribute is currently not exposed in the sysfs interface
as the device has not been set as doing wakealarm when device_register
is called. Changing the order of the calls fixes that problem. Interrupts
are cleared in check_rtc_status prior to requesting the interrupt.

This is only set if an irq is defined. If irq registration fails then
set wakeup_capable to false. With this change the sysfs wakealarm
attribute will be left visible but it is non functional. rtcwake
still returns that the device is not enabled for wakeup.

Signed-off-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-ds3232.c