drivers/rtc/rtc-r9701.c: avoid second call to rtc_valid_tm()
r9701_get_datetime() calls rtc_valid_tm() and returns the value returned by rtc_valid_tm(), which can be used in the `if', so calling rtc_valid_tm() a second time is not required. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Anatolij Gustschin <agust@denx.de> Cc: Andreas Dumberger <andreas.dumberger@tqs.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
064407f1c0
commit
aa11ec593e
|
@ -138,8 +138,7 @@ static int __devinit r9701_probe(struct spi_device *spi)
|
||||||
* contain invalid values. If so, try to write a default date:
|
* contain invalid values. If so, try to write a default date:
|
||||||
* 2000/1/1 00:00:00
|
* 2000/1/1 00:00:00
|
||||||
*/
|
*/
|
||||||
r9701_get_datetime(&spi->dev, &dt);
|
if (r9701_get_datetime(&spi->dev, &dt)) {
|
||||||
if (rtc_valid_tm(&dt)) {
|
|
||||||
dev_info(&spi->dev, "trying to repair invalid date/time\n");
|
dev_info(&spi->dev, "trying to repair invalid date/time\n");
|
||||||
dt.tm_sec = 0;
|
dt.tm_sec = 0;
|
||||||
dt.tm_min = 0;
|
dt.tm_min = 0;
|
||||||
|
|
Loading…
Reference in a new issue