Commit 3abb1ad
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>1 parent 51c4cfe commit 3abb1ad
1 file changed
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1134 | 1134 | | |
1135 | 1135 | | |
1136 | 1136 | | |
1137 | | - | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
1138 | 1141 | | |
1139 | 1142 | | |
1140 | 1143 | | |
| |||
1148 | 1151 | | |
1149 | 1152 | | |
1150 | 1153 | | |
| 1154 | + | |
| 1155 | + | |
1151 | 1156 | | |
1152 | | - | |
1153 | | - | |
1154 | | - | |
| 1157 | + | |
1155 | 1158 | | |
1156 | | - | |
1157 | 1159 | | |
1158 | 1160 | | |
1159 | 1161 | | |
| |||
0 commit comments