diff options
Diffstat (limited to 'bsps')
-rw-r--r-- | bsps/arm/altera-cyclone-v/rtc/rtc.c | 10 | ||||
-rw-r--r-- | bsps/shared/dev/rtc/rtc-support.c | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/bsps/arm/altera-cyclone-v/rtc/rtc.c b/bsps/arm/altera-cyclone-v/rtc/rtc.c index 3e8c68e789..fb30da8d66 100644 --- a/bsps/arm/altera-cyclone-v/rtc/rtc.c +++ b/bsps/arm/altera-cyclone-v/rtc/rtc.c @@ -353,10 +353,9 @@ static int altera_cyclone_v_ds1339_get_time(int minor, rtems_time_of_day* tod) temp_tod.month = ds1339_get_month(&time); temp_tod.year = ds1339_get_year(&time); - if (_TOD_Validate(&temp_tod)) + sc = _TOD_Validate(&temp_tod) + if (sc == RTEMS_SUCCESSFUL) memcpy(tod, &temp_tod, sizeof(temp_tod)); - else - sc = RTEMS_INVALID_CLOCK; } return -sc; @@ -737,10 +736,9 @@ static int altera_cyclone_v_m41st87_get_time(int minor, rtems_time_of_day* tod) temp_tod.month = m41st87_get_month(&time); temp_tod.year = m41st87_get_year(&time); - if (_TOD_Validate(&temp_tod)) + sc = _TOD_Validate(&temp_tod); + if (sc == RTEMS_SUCCESSFUL) memcpy(tod, &temp_tod, sizeof(temp_tod)); - else - sc = RTEMS_INVALID_CLOCK; return -sc; } diff --git a/bsps/shared/dev/rtc/rtc-support.c b/bsps/shared/dev/rtc/rtc-support.c index 765bfe1d6b..04b8f0c847 100644 --- a/bsps/shared/dev/rtc/rtc-support.c +++ b/bsps/shared/dev/rtc/rtc-support.c @@ -255,7 +255,7 @@ int setRealTime( if (!RTC_Is_present()) return -1; - if ( !_TOD_Validate(tod) ) + if (_TOD_Validate(tod) != RTEMS_SUCCESSFUL) return -1; RTC_Table[RTC_Minor].pDeviceFns->deviceSetTime(RTC_Minor, tod); |