rtc: allow rtc_set to return an error and use it in cmd_date
Subsystems (2)
PATCH 1/1 rtc: allow rtc_set to return an error and use it in cmd_date
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
--- board/bmw/m48t59y.c | 4 ++-- board/cray/L1/L1.c | 4 ++-- board/etin/debris/phantom.c | 4 +++- board/mousse/m48t59y.c | 4 ++-- common/cmd_date.c | 28 ++++++++++++++++++++-------- cpu/s3c44b0/cpu.c | 4 +++- drivers/rtc/bfin_rtc.c | 6 ++++-- drivers/rtc/ds12887.c | 4 +++- drivers/rtc/ds1302.c | 5 +++-- drivers/rtc/ds1306.c | 6 ++++-- drivers/rtc/ds1307.c | 4 +++- drivers/rtc/ds1337.c | 4 +++- drivers/rtc/ds1374.c | 4 +++- drivers/rtc/ds1556.c | 4 +++- drivers/rtc/ds164x.c | 4 +++- drivers/rtc/ds174x.c | 4 +++- drivers/rtc/ds3231.c | 4 +++- drivers/rtc/isl1208.c | 4 +++- drivers/rtc/m41t11.c | 4 +++- drivers/rtc/m41t60.c | 8 +++++--- drivers/rtc/m41t62.c | 8 ++++++-- drivers/rtc/m48t35ax.c | 4 +++- drivers/rtc/max6900.c | 4 +++- drivers/rtc/mc13783-rtc.c | 8 +++++--- drivers/rtc/mc146818.c | 3 ++- drivers/rtc/mcfrtc.c | 4 +++- drivers/rtc/mk48t59.c | 6 ++++-- drivers/rtc/mpc5xxx.c | 4 +++- drivers/rtc/mpc8xx.c | 4 +++- drivers/rtc/pcf8563.c | 4 +++- drivers/rtc/pl031.c | 6 ++++-- drivers/rtc/rs5c372.c | 10 +++++++--- drivers/rtc/rx8025.c | 4 +++- drivers/rtc/s3c24x0_rtc.c | 4 +++- drivers/rtc/x1205.c | 4 +++- include/rtc.h | 2 +- 36 files changed, 134 insertions(+), 58 deletions(-) mode change 100755 => 100644 drivers/rtc/pl031.c
board/bmw/m48t59y.c +2 -2
@@ -299,8 +299,7 @@ rtc_get( struct rtc_time *tmp )return 0 ; } -void -rtc_set (struct rtc_time *tmp ) +int rtc_set (struct rtc_time *tmp ) { m48_tod_set(tmp->tm_year, /* 1980-2079 */ tmp->tm_mon, /* 01-12 */
@@ -315,6 +314,7 @@ rtc_set( struct rtc_time *tmp ) tmp->tm_hour, tmp->tm_min, tmp->tm_sec);#endif +return 0 ; }void
board/cray/L1/L1.c +2 -2
@@ -181,9 +181,9 @@ int rtc_get (struct rtc_time *tmp) {return 0 ; } -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) { -return ; +return 0 ; }void rtc_reset (void ) {
board/etin/debris/phantom.c +3 -1
@@ -254,7 +254,7 @@ int rtc_get( struct rtc_time *tmp)return 0 ; } -void rtc_set (struct rtc_time *tmp ) +int rtc_set (struct rtc_time *tmp ) {if (phantom_flag <0 ) phantom_flag =get_phantom_flag ();
@@ -307,6 +307,8 @@ void rtc_set( struct rtc_time *tmp )/* unlock clock registers after read */ rtc_write( RTC_CONTROLA, ( reg_a & ~RTC_CA_WRITE )); } + +return 0 ; }#endif
board/mousse/m48t59y.c +2 -2
@@ -299,8 +299,7 @@ rtc_get( struct rtc_time *tmp )return 0 ; } -void -rtc_set (struct rtc_time *tmp ) +int rtc_set (struct rtc_time *tmp ) { m48_tod_set(tmp->tm_year, /* 1980-2079 */ tmp->tm_mon, /* 01-12 */
@@ -315,6 +314,7 @@ rtc_set( struct rtc_time *tmp ) tmp->tm_hour, tmp->tm_min, tmp->tm_sec);#endif +return 0 ; }void
common/cmd_date.c +20 -8
@@ -56,18 +56,30 @@ int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])rtc_reset (); }else {/* initialize tm with current time */ -rtc_get (&tm); -/* insert new date & time */ -if (mk_date (argv[1 ], &tm) !=0 ) { -puts ("## Bad date format\n" ); -break ; + rcode =rtc_get (&tm); + +if (!rcode) { +/* insert new date & time */ +if (mk_date (argv[1 ], &tm) !=0 ) { +puts ("## Bad date format\n" ); +break ; + } +/* and write to RTC */ + rcode =rtc_set (&tm); +if (rcode) +puts ("## Set date failled\n" ); + }else { +puts ("## Get date failled\n" ); } -/* and write to RTC */ -rtc_set (&tm); }/* FALL TROUGH */ case 1 :/* get date & time */ -rtc_get (&tm); + rcode =rtc_get (&tm); + +if (rcode) { +puts ("## Get date failled\n" ); +break ; + } printf ("Date: %4d-%02d-%02d (%sday) Time: %2d:%02d:%02d\n", tm.tm_year, tm.tm_mon, tm.tm_mday,
cpu/s3c44b0/cpu.c +3 -1
@@ -188,7 +188,7 @@ int rtc_get (struct rtc_time* tm)return 0 ; } -void rtc_set (struct rtc_time * tm) +int rtc_set (struct rtc_time * tm) {if (tm->tm_year <2000 ) tm->tm_year -=1900 ;
@@ -204,6 +204,8 @@ void rtc_set (struct rtc_time* tm)BCDMIN =HEX2BCD (tm->tm_min);BCDSEC =HEX2BCD (tm->tm_sec);RTCCON &=1 ; + +return 0 ; }void rtc_reset (void )
drivers/rtc/bfin_rtc.c +4 -2
@@ -53,7 +53,7 @@ int rtc_init(void)/* Set the time. Get the time_in_secs which is the number of seconds since Jan 1970 and set the RTC registers * based on this value. */ -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {unsigned long remain, days, hrs, mins, secs;
@@ -61,7 +61,7 @@ void rtc_set(struct rtc_time *tmp)if (tmp ==NULL ) {puts ("Error setting the date/time\n" ); -return ; +return -1 ; }wait_for_complete ();
@@ -82,6 +82,8 @@ void rtc_set(struct rtc_time *tmp)/* Encode these time values into our RTC_STAT register */ bfin_write_RTC_STAT (SET_ALARM (days, hrs, mins, secs)); + +return 0 ; }/* Read the time from the RTC_STAT. time_in_seconds is seconds since Jan 1970 */
drivers/rtc/ds12887.c +3 -1
@@ -154,7 +154,7 @@ elsereturn 0 ; } -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {uchar save_ctrl_b;uchar sec, min, hour, mday, wday, mon, year;
@@ -202,6 +202,8 @@ void rtc_set (struct rtc_time *tmp)/* enables the RTC to update the regs */ save_ctrl_b &= ~RTC_CB_SET ;rtc_write (RTC_CONTROL_B , save_ctrl_b); + +return 0 ; }void rtc_reset (void )
drivers/rtc/ds1302.c +3 -2
@@ -287,8 +287,7 @@ rtc_get(struct rtc_time *tmp)return rel; } -void -rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {struct ds1302_st bbclk;unsigned char b=0 ;
@@ -326,6 +325,8 @@ rtc_set(struct rtc_time *tmp)write_ser_drv (0x8e ,&b,1 );/* disable write protect */ write_ser_drv (0xbe ,(unsigned char *)&bbclk,8 );/* write burst */ + + return 0; }#endif
drivers/rtc/ds1306.c +4 -2
@@ -141,7 +141,7 @@ int rtc_get (struct rtc_time *tmp)/* ------------------------------------------------------------------------- */ /* set clock time in DS1306 RTC and in MPC8xx RTC */ -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {volatile immap_t *immap = (immap_t *)CFG_IMMR ;
@@ -209,6 +209,8 @@ void rtc_set (struct rtc_time *tmp)debug ("Set DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n" , tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, tmp->tm_hour, tmp->tm_min, tmp->tm_sec); + +return 0 ; }/* ------------------------------------------------------------------------- */
@@ -371,7 +373,7 @@ int rtc_get (struct rtc_time *tmp)/* ------------------------------------------------------------------------- */ /* set clock time from *tmp in DS1306 RTC */ -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {/* Assuming Vcc = 2.0V (lowest speed) */ if (!slave) {
drivers/rtc/ds1307.c +3 -1
@@ -128,7 +128,7 @@ int rtc_get (struct rtc_time *tmp)/* * Set the RTC */ -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) { DEBUGR ("Set DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n", tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
@@ -144,6 +144,8 @@ void rtc_set (struct rtc_time *tmp)rtc_write (RTC_HR_REG_ADDR ,bin2bcd (tmp->tm_hour));rtc_write (RTC_MIN_REG_ADDR ,bin2bcd (tmp->tm_min));rtc_write (RTC_SEC_REG_ADDR ,bin2bcd (tmp->tm_sec)); + +return 0 ; }
drivers/rtc/ds1337.c +3 -1
@@ -132,7 +132,7 @@ int rtc_get (struct rtc_time *tmp)/* * Set the RTC */ -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {uchar century;
@@ -150,6 +150,8 @@ void rtc_set (struct rtc_time *tmp)rtc_write (RTC_HR_REG_ADDR ,bin2bcd (tmp->tm_hour));rtc_write (RTC_MIN_REG_ADDR ,bin2bcd (tmp->tm_min));rtc_write (RTC_SEC_REG_ADDR ,bin2bcd (tmp->tm_sec)); + +return 0 ; }
drivers/rtc/ds1374.c +3 -1
@@ -160,7 +160,7 @@ int rtc_get (struct rtc_time *tm){/* * Set the RTC */ -void rtc_set (struct rtc_time *tmp){ +int rtc_set (struct rtc_time *tmp){unsigned long time;unsigned i;
@@ -186,6 +186,8 @@ void rtc_set (struct rtc_time *tmp){/* Start clock */ rtc_write (RTC_CTL_ADDR ,RTC_CTL_BIT_EN_OSC , FALSE); + +return 0 ; }/*
drivers/rtc/ds1556.c +3 -1
@@ -120,7 +120,7 @@ int rtc_get( struct rtc_time *tmp )return 0 ; } -void rtc_set (struct rtc_time *tmp ) +int rtc_set (struct rtc_time *tmp ) {uchar reg_a;#ifdef RTC_DEBUG
@@ -146,6 +146,8 @@ void rtc_set( struct rtc_time *tmp )/* unlock clock registers after read */ rtc_write (RTC_CONTROLA , ( reg_a & ~RTC_CA_WRITE )); + +return 0 ; }void rtc_reset (void )
drivers/rtc/ds164x.c +3 -1
@@ -119,7 +119,7 @@ int rtc_get( struct rtc_time *tmp )return 0 ; } -void rtc_set (struct rtc_time *tmp ) +int rtc_set (struct rtc_time *tmp ) {uchar reg_a;
@@ -145,6 +145,8 @@ void rtc_set( struct rtc_time *tmp )/* unlock clock registers after read */ rtc_write (RTC_CONTROLA , ( reg_a & ~RTC_CA_WRITE )); + +return 0 ; }void rtc_reset (void )
drivers/rtc/ds174x.c +3 -1
@@ -117,7 +117,7 @@ int rtc_get( struct rtc_time *tmp )return 0 ; } -void rtc_set (struct rtc_time *tmp ) +int rtc_set (struct rtc_time *tmp ) {uchar reg_a;#ifdef RTC_DEBUG
@@ -143,6 +143,8 @@ void rtc_set( struct rtc_time *tmp )/* unlock clock registers after read */ rtc_write (RTC_CONTROLA , ( reg_a & ~RTC_CA_WRITE )); + +return 0 ; }void rtc_reset (void )
drivers/rtc/ds3231.c +3 -1
@@ -134,7 +134,7 @@ int rtc_get (struct rtc_time *tmp)/* * Set the RTC */ -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {uchar century;
@@ -152,6 +152,8 @@ void rtc_set (struct rtc_time *tmp)rtc_write (RTC_HR_REG_ADDR ,bin2bcd (tmp->tm_hour));rtc_write (RTC_MIN_REG_ADDR ,bin2bcd (tmp->tm_min));rtc_write (RTC_SEC_REG_ADDR ,bin2bcd (tmp->tm_sec)); + +return 0 ; }
drivers/rtc/isl1208.c +3 -1
@@ -118,7 +118,7 @@ int rtc_get (struct rtc_time *tmp)/* * Set the RTC */ -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) { DEBUGR ("Set DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n", tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
@@ -139,6 +139,8 @@ void rtc_set (struct rtc_time *tmp)/* disable write */ rtc_write (RTC_STAT_REG_ADDR ,rtc_read (RTC_STAT_REG_ADDR ) & ~RTC_STAT_BIT_WRTC ); + +return 0 ; }void rtc_reset (void )
drivers/rtc/m41t11.c +3 -1
@@ -143,7 +143,7 @@ int rtc_get (struct rtc_time *tmp)return rel; } -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {uchar data[RTC_REG_CNT ];
@@ -176,6 +176,8 @@ void rtc_set (struct rtc_time *tmp) }#endif i2c_write (CFG_I2C_RTC_ADDR ,RTC_SEC_ADDR ,1 , data,RTC_REG_CNT ); + +return 0 ; }void rtc_reset (void )
drivers/rtc/m41t60.c +5 -3
@@ -193,12 +193,12 @@ int rtc_get(struct rtc_time *tmp)return 0 ; } -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {uchar *const data =rtc_validate ();if (!data) -return ; +return -1 ; debug("Set DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n", tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
@@ -214,8 +214,10 @@ void rtc_set(struct rtc_time *tmp) data[RTC_DAY ] =bin2bcd (tmp->tm_wday +1 ) &0x07 ;if (i2c_write (CFG_I2C_RTC_ADDR ,0 ,1 , data,RTC_REG_CNT )) {printf ("I2C write failed in rtc_set()\n" ); -return ; +return -1 ; } + +return 0 ; }void rtc_reset (void )
drivers/rtc/m41t62.c +6 -2
@@ -96,7 +96,7 @@ int rtc_get(struct rtc_time *tm)return 0 ; } -void rtc_set (struct rtc_time *tm) +int rtc_set (struct rtc_time *tm) {u8 buf[M41T62_DATETIME_REG_SIZE ];
@@ -123,8 +123,12 @@ void rtc_set(struct rtc_time *tm)/* assume 20YY not 19YY */ buf[M41T62_REG_YEAR ] =BIN2BCD (tm->tm_year %100 ); -if (i2c_write (CFG_I2C_RTC_ADDR ,0 ,1 , buf,M41T62_DATETIME_REG_SIZE )) +if (i2c_write (CFG_I2C_RTC_ADDR ,0 ,1 , buf,M41T62_DATETIME_REG_SIZE )) {printf ("I2C write failed in %s()\n" , __func__); +return -1 ; + } + +return 0 ; }void rtc_reset (void )
drivers/rtc/m48t35ax.c +3 -1
@@ -87,7 +87,7 @@ int rtc_get (struct rtc_time *tmp)return 0 ; } -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {uchar ccr;/* Clock control register */ uchar century;
@@ -116,6 +116,8 @@ void rtc_set (struct rtc_time *tmp) ccr =rtc_read (0 ); ccr = ccr &0x7F ;rtc_write (0 , ccr); + +return 0 ; }void rtc_reset (void )
drivers/rtc/max6900.c +3 -1
@@ -107,7 +107,7 @@ int rtc_get (struct rtc_time *tmp)return 0 ; } -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) { debug ( "Set DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n",
@@ -124,6 +124,8 @@ void rtc_set (struct rtc_time *tmp)rtc_write (0x84 ,bin2bcd (tmp->tm_hour));rtc_write (0x82 ,bin2bcd (tmp->tm_min ));rtc_write (0x80 ,bin2bcd (tmp->tm_sec )); + +return 0 ; }void rtc_reset (void )
drivers/rtc/mc13783-rtc.c +5 -3
@@ -77,7 +77,7 @@ int rtc_get(struct rtc_time *rtc)return 0 ; } -void rtc_set (struct rtc_time *rtc) +int rtc_set (struct rtc_time *rtc) {u32 time, day, reg;
@@ -86,7 +86,7 @@ void rtc_set(struct rtc_time *rtc) slave =spi_setup_slave (1 ,0 ,1000000 ,SPI_MODE_2 |SPI_CS_HIGH );if (!slave) -return ; +return -1 ; } time = mktime(rtc->tm_year, rtc->tm_mon, rtc->tm_mday,
@@ -95,7 +95,7 @@ void rtc_set(struct rtc_time *rtc) time %=86400 ;if (spi_claim_bus (slave)) -return ; +return -1 ; reg =0x2c000000 | day |0x80000000 ; spi_xfer(slave, 32, (uchar *)®, (uchar *)&day,
@@ -106,6 +106,8 @@ void rtc_set(struct rtc_time *rtc) SPI_XFER_BEGIN | SPI_XFER_END);spi_release_bus (slave); + +return -1 ; }void rtc_reset (void )
drivers/rtc/mc146818.c +2 -1
@@ -105,7 +105,7 @@ int rtc_get (struct rtc_time *tmp)return 0 ; } -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {#ifdef RTC_DEBUG printf ( "Set DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n",
@@ -127,6 +127,7 @@ void rtc_set (struct rtc_time *tmp)rtc_write (RTC_SECONDS ,bin2bcd (tmp->tm_sec ));rtc_write (RTC_CONFIG_B ,0x02 );/* enables the RTC to update the regs */ +return 0 ; }void rtc_reset (void )
drivers/rtc/mcfrtc.c +3 -1
@@ -68,7 +68,7 @@ int rtc_get(struct rtc_time *tmp)return 0 ; } -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {volatile rtc_t *rtc = (rtc_t *) (CFG_MCFRTC_BASE );
@@ -106,6 +106,8 @@ void rtc_set(struct rtc_time *tmp) rtc->days = days; rtc->hourmin = (tmp->tm_hour <<8 ) | tmp->tm_min; rtc->seconds = tmp->tm_sec; + +return 0 ; }void rtc_reset (void )
drivers/rtc/mk48t59.c +4 -2
@@ -185,7 +185,7 @@ int rtc_get (struct rtc_time *tmp)return 0 ; } -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {uchar save_ctrl_a;
@@ -210,6 +210,8 @@ void rtc_set (struct rtc_time *tmp) save_ctrl_a &= ~RTC_CA_WRITE ;rtc_write (RTC_CONTROLA , save_ctrl_a);/* enables the RTC to update the regs */ + +return 0 ; }void rtc_reset (void )
@@ -225,7 +227,7 @@ void rtc_reset (void)rtc_write (RTC_CONTROLB , control_b); } -void rtc_set_watchdog (short multi,short res) +int rtc_set_watchdog (short multi,short res) {uchar wd_value;
drivers/rtc/mpc5xxx.c +3 -1
@@ -88,7 +88,7 @@ int rtc_get (struct rtc_time *tmp)/***************************************************************************** * set time *****************************************************************************/ -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {RTC5200 *rtc = (RTC5200 *) (CFG_MBAR +0x800 );ulong time, date, year;
@@ -129,6 +129,8 @@ void rtc_set (struct rtc_time *tmp)udelay (1000 ); rtc->tsr = time;udelay (1000 ); + +return 0 ; }/*****************************************************************************
drivers/rtc/mpc8xx.c +3 -1
@@ -51,7 +51,7 @@ int rtc_get (struct rtc_time *tmp)return 0 ; } -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {volatile immap_t *immr = (immap_t *)CFG_IMMR ;ulong tim;
@@ -65,6 +65,8 @@ void rtc_set (struct rtc_time *tmp) immr->im_sitk.sitk_rtck =KAPWR_KEY ; immr->im_sit.sit_rtc = tim; + +return 0 ; }void rtc_reset (void )
drivers/rtc/pcf8563.c +3 -1
@@ -86,7 +86,7 @@ int rtc_get (struct rtc_time *tmp)return rel; } -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {uchar century;
@@ -104,6 +104,8 @@ void rtc_set (struct rtc_time *tmp)rtc_write (0x04 ,bin2bcd (tmp->tm_hour));rtc_write (0x03 ,bin2bcd (tmp->tm_min ));rtc_write (0x02 ,bin2bcd (tmp->tm_sec )); + +return 0 ; }void rtc_reset (void )
drivers/rtc/pl031.c +4 -2
@@ -75,7 +75,7 @@ void rtc_reset(void)/* * Set the RTC */ -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {unsigned long tim;
@@ -84,7 +84,7 @@ void rtc_set(struct rtc_time *tmp)if (tmp ==NULL ) {puts ("Error setting the date/time\n" ); -return ; +return -1 ; }/* Calculate number of seconds this incoming time represents */
@@ -92,6 +92,8 @@ void rtc_set(struct rtc_time *tmp) tmp->tm_hour, tmp->tm_min, tmp->tm_sec);RTC_WRITE_REG (RTC_LR , tim); + +return -1 ; }/*
drivers/rtc/rs5c372.c +7 -3
@@ -205,7 +205,7 @@ rtc_set (struct rtc_time *tmp)rs5c372_enable ();if (!setup_done) -return ; +return -1 ;if (rtc_debug >2 ) {printf ("rtc_set: tm_year = %d\n" , tmp->tm_year);
@@ -249,11 +249,15 @@ rtc_set (struct rtc_time *tmp) buf[7 ] =bin2bcd (tmp->tm_year %100 ); ret =i2c_write (CFG_I2C_RTC_ADDR ,0 ,0 , buf,8 ); -if (ret !=0 ) +if (ret !=0 ) {printf ("rs5c372_set_datetime(), i2c_master_send() returned %d\n" ,ret); +return -1 ; + } + }else { +return -1 ; } -return ; +return 0 ; }/*
drivers/rtc/rx8025.c +3 -1
@@ -154,7 +154,7 @@ int rtc_get (struct rtc_time *tmp)/* * Set the RTC */ -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) { DEBUGR ("Set DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n", tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
@@ -172,6 +172,8 @@ void rtc_set (struct rtc_time *tmp)rtc_write (RTC_SEC_REG_ADDR ,bin2bcd (tmp->tm_sec));rtc_write (RTC_CTL1_REG_ADDR ,RTC_CTL1_BIT_2412 ); + +return 0 ; }/*
drivers/rtc/s3c24x0_rtc.c +3 -1
@@ -135,7 +135,7 @@ int rtc_get (struct rtc_time *tmp)return 0 ; } -void rtc_set (struct rtc_time *tmp) +int rtc_set (struct rtc_time *tmp) {S3C24X0_RTC *const rtc =S3C24X0_GetBase_RTC ();uchar sec, min, hour, mday, wday, mon, year;
@@ -167,6 +167,8 @@ void rtc_set (struct rtc_time *tmp)/* disable access to RTC registers */ SetRTC_Access (RTC_DISABLE ); + +return 0 ; }void rtc_reset (void )
drivers/rtc/x1205.c +3 -1
@@ -134,7 +134,7 @@ int rtc_get(struct rtc_time *tm)return 0 ; } -void rtc_set (struct rtc_time *tm) +int rtc_set (struct rtc_time *tm) {int i;u8 buf[8 ];
@@ -168,6 +168,8 @@ void rtc_set(struct rtc_time *tm)rtc_write (X1205_CCR_BASE + i, buf[i]);rtc_write (X1205_REG_SR ,0 ); + +return 0 ; }void rtc_reset (void )
include/rtc.h +1 -1
@@ -53,7 +53,7 @@ struct rtc_time { };int rtc_get (struct rtc_time *); -void rtc_set (struct rtc_time *); +int rtc_set (struct rtc_time *);void rtc_reset (void );void GregorianDay (struct rtc_time *);
Signature · 1 line
1.5.6.5
Wolfgang Denk
AppliedPATCH 1/1 rtc: allow rtc_set to return an error and use it in cmd_date
Dear Jean-Christophe PLAGNIOL-VILLARD,
Quoted 32 lines · In message <[email protected]> you wrote:
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- board/bmw/m48t59y.c | 4 ++-- board/cray/L1/L1.c | 4 ++-- board/etin/debris/phantom.c | 4 +++- board/mousse/m48t59y.c | 4 ++-- common/cmd_date.c | 28 ++++++++++++++++++++-------- cpu/s3c44b0/cpu.c | 4 +++- drivers/rtc/bfin_rtc.c | 6 ++++-- drivers/rtc/ds12887.c | 4 +++- drivers/rtc/ds1302.c | 5 +++-- drivers/rtc/ds1306.c | 6 ++++-- drivers/rtc/ds1307.c | 4 +++- drivers/rtc/ds1337.c | 4 +++- drivers/rtc/ds1374.c | 4 +++- drivers/rtc/ds1556.c | 4 +++- drivers/rtc/ds164x.c | 4 +++- drivers/rtc/ds174x.c | 4 +++- drivers/rtc/ds3231.c | 4 +++- drivers/rtc/isl1208.c | 4 +++- drivers/rtc/m41t11.c | 4 +++- drivers/rtc/m41t60.c | 8 +++++--- drivers/rtc/m41t62.c | 8 ++++++-- drivers/rtc/m48t35ax.c | 4 +++- drivers/rtc/max6900.c | 4 +++- drivers/rtc/mc13783-rtc.c | 8 +++++--- drivers/rtc/mc146818.c | 3 ++- drivers/rtc/mcfrtc.c | 4 +++- drivers/rtc/mk48t59.c | 6 ++++-- drivers/rtc/mpc5xxx.c | 4 +++- drivers/rtc/mpc8xx.c | 4 +++- drivers/rtc/pcf8563.c | 4 +++-
Quoted 8 lines
drivers/rtc/pl031.c | 6 ++++-- drivers/rtc/rs5c372.c | 10 +++++++--- drivers/rtc/rx8025.c | 4 +++- drivers/rtc/s3c24x0_rtc.c | 4 +++- drivers/rtc/x1205.c | 4 +++- include/rtc.h | 2 +- 36 files changed, 134 insertions(+), 58 deletions(-) mode change 100755 => 100644 drivers/rtc/pl031.c
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de No man knows what true happiness is until he gets married. By then, of course, its too late.