提交 bc83a141 编写于 作者: A Akinobu Mita 提交者: Alexandre Belloni

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: NAkinobu Mita <akinobu.mita@gmail.com>
Cc: Sergey Yanovich <ynvich@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
上级 05a7f27a
...@@ -53,7 +53,7 @@ static int ds1302_rtc_set_time(struct device *dev, struct rtc_time *time) ...@@ -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, status = spi_write_then_read(spi, buf, 2,
NULL, 0); NULL, 0);
if (!status) if (status)
return status; return status;
/* Write registers starting at the first time/date address. */ /* Write registers starting at the first time/date address. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册