diff mbox series

[U-Boot,v1,2/5] rtc: ds1374: remove redundant code in rtc_reset

Message ID 20180321024037.26393-3-judge.packham@gmail.com
State Accepted
Commit a6bf689a70432ef035033aa81370ee953ecdf25d
Delegated to: Tom Rini
Headers show
Series rtc: remove redundant code in rtc_reset | expand

Commit Message

Chris Packham March 21, 2018, 2:40 a.m. UTC
As of commit 1a1fa2406689 ("rtc: Set valid date after reset") the
command "date reset" will set the date/time to 2000-01-01 0:00:00 after
calling rtc_reset(). This means that the ds1374 implementation of
rtc_reset() doesn't need to call rtc_set().

Signed-off-by: Chris Packham <judge.packham@gmail.com>
---

 drivers/rtc/ds1374.c | 15 ---------------
 1 file changed, 15 deletions(-)

Comments

Tom Rini April 7, 2018, 1:25 p.m. UTC | #1
On Wed, Mar 21, 2018 at 03:40:34PM +1300, Chris Packham wrote:

> As of commit 1a1fa2406689 ("rtc: Set valid date after reset") the
> command "date reset" will set the date/time to 2000-01-01 0:00:00 after
> calling rtc_reset(). This means that the ds1374 implementation of
> rtc_reset() doesn't need to call rtc_set().
> 
> Signed-off-by: Chris Packham <judge.packham@gmail.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/drivers/rtc/ds1374.c b/drivers/rtc/ds1374.c
index 78473570b9df..9e440d845766 100644
--- a/drivers/rtc/ds1374.c
+++ b/drivers/rtc/ds1374.c
@@ -172,8 +172,6 @@  int rtc_set (struct rtc_time *tmp){
  */
 void rtc_reset (void){
 
-	struct rtc_time tmp;
-
 	/* clear status flags */
 	rtc_write(RTC_SR_ADDR, (RTC_SR_BIT_AF|RTC_SR_BIT_OSF), false); /* clearing OSF and AF */
 
@@ -189,19 +187,6 @@  void rtc_reset (void){
 				|RTC_CTL_BIT_BBSQW), true);/* disable WD/ALM, WDSTR set to INT-pin,
 							      set BBSQW and SQW to 32k
 							      - set to 1 */
-	tmp.tm_year = 1970;
-	tmp.tm_mon = 1;
-	tmp.tm_mday= 1;
-	tmp.tm_hour = 0;
-	tmp.tm_min = 0;
-	tmp.tm_sec = 0;
-
-	rtc_set(&tmp);
-
-	printf("RTC:   %4d-%02d-%02d %2d:%02d:%02d UTC\n",
-		tmp.tm_year, tmp.tm_mon, tmp.tm_mday,
-		tmp.tm_hour, tmp.tm_min, tmp.tm_sec);
-
 	rtc_write(RTC_WD_ALM_CNT_BYTE2_ADDR, 0xAC, true);
 	rtc_write(RTC_WD_ALM_CNT_BYTE1_ADDR, 0xDE, true);
 	rtc_write(RTC_WD_ALM_CNT_BYTE2_ADDR, 0xAD, true);