mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
rtc: ds1302: fix error check in set_time
The set_time callback for rtc-ds1302 doesn't write clock registers because the error check for the return value from spi_write_then_read() is not correct. spi_write_then_read() which returns zero on success. Signed-off-by: Akinobu Mita <[email protected]> Cc: Sergey Yanovich <[email protected]> Cc: Alessandro Zummo <[email protected]> Cc: Alexandre Belloni <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
This commit is contained in:
parent
05a7f27a88
commit
bc83a141b8
1 changed files with 1 additions and 1 deletions
|
|
@ -53,7 +53,7 @@ static int ds1302_rtc_set_time(struct device *dev, struct rtc_time *time)
|
|||
|
||||
status = spi_write_then_read(spi, buf, 2,
|
||||
NULL, 0);
|
||||
if (!status)
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
/* Write registers starting at the first time/date address. */
|
||||
|
|
|
|||
Loading…
Reference in a new issue