]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: ds1307: fix alarm reading at probe time
authorSimon Guinot <simon.guinot@sequanux.org>
Thu, 26 Nov 2015 14:37:13 +0000 (15:37 +0100)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Thu, 26 Nov 2015 17:11:26 +0000 (18:11 +0100)
commit0ab19009b46c0084ec2f6a189ad97df6c7547c3f
tree88ead2d36f6031a3252bc5f291b738735464f336
parentcb1b84a7534411bef85ca76317460a34e5f8a21f
rtc: ds1307: fix alarm reading at probe time

With the actual code, read_alarm() always returns -EINVAL when called
during the RTC device registration. This prevents from retrieving an
already configured alarm in hardware.

This patch fixes the issue by moving the HAS_ALARM bit configuration
(if supported by the hardware) above the rtc_device_register() call.

Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-ds1307.c