{
struct rtc_time rtc_tm;
memset(&rtc_tm, 0, sizeof (struct rtc_time));
get_rtc_time(&rtc_tm);
if (copy_to_user((struct rtc_time*)arg, &rtc_tm, sizeof(struct rtc_time)))
return -EFAULT;
struct rtc_time tm;
memset(&tm, 0, sizeof (struct rtc_time));
get_rtc_time(&tm);
if (copy_to_user((struct rtc_time *) arg, &tm, sizeof(struct rtc_time))) {
/* Ensure clock and real-time-mode-register are accessible */
msr = rtc->msr & 0xc0;
rtc->msr = 0x40;
memset(&wtime, 0, sizeof (struct rtc_time));
do {
wtime.tm_sec = BCD2BIN(rtc->bcd_sec);
wtime.tm_min = BCD2BIN(rtc->bcd_min);
cli();
rtc->ctrl = RTC_READ;
wtime.tm_hour = BCD2BIN(rtc->bcd_hr);
switch (cmd) {
case RTC_RD_TIME: /* Read the time/date from RTC */
memset(&wtime, 0, sizeof(struct rtc_time));
get_rtc_time(&wtime);
break;
}
ppc_md.get_rtc_time(&wtime);
static void
convert_from_efi_time(efi_time_t *eft, struct rtc_time *wtime)
memset(wtime, 0, sizeof(struct rtc_time));
wtime->tm_sec = eft->second;
wtime->tm_min = eft->minute;
wtime->tm_hour = eft->hour;
* tm_min, and tm_sec values are filled in.
*/
get_rtc_alm_time(&wtime);
case RTC_ALM_READ: /* Read the present alarm time */
memset(&ttime, 0, sizeof(struct timeval));
if (hp_sdc_rtc_read_mt(&ttime)) return -EFAULT;
if (hp_sdc_rtc_read_bbrtc(&wtime)) return -EFAULT;
case RTC_RD_TIME:
if (ppc_md.get_rtc_time)
memset(&rtc_tm, 0, sizeof(struct rtc_time));
switch (cmd)
case RTCGET:
ds1286_get_alm_time(&wtime);
ds1286_get_time(&wtime);