Skip to content

Commit 969c3cc

Browse files
andiplaalexandrebelloni
authored andcommitted
rtc: ds1390: fix number of bytes read from RTC
The spi_write_then_read() reads 8 bytes starting from DS1390_REG_SECONDS (== 0x01), so the last byte read would already be part of the alarm (Tenths and Hundredths of Seconds) feature. However 7 bytes are engouh -- seconds (0x01), minutes (0x02), hours (0x03), day (0x04), date (0x05), month/century (0x06) and year (0x07). Signed-off-by: Andreas Gabriel-Platschek <andi.platschek@gmail.com> Link: https://patch.msgid.link/20260209053439.313825-1-andi.platschek@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 76e8919 commit 969c3cc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/rtc/rtc-ds1390.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static int ds1390_read_time(struct device *dev, struct rtc_time *dt)
134134
chip->txrx_buf[0] = DS1390_REG_SECONDS;
135135

136136
/* do the i/o */
137-
status = spi_write_then_read(spi, chip->txrx_buf, 1, chip->txrx_buf, 8);
137+
status = spi_write_then_read(spi, chip->txrx_buf, 1, chip->txrx_buf, 7);
138138
if (status != 0)
139139
return status;
140140

0 commit comments

Comments
 (0)