|
|
@@ -104,42 +104,6 @@ static efi_status_t __init phys_efi_set_virtual_address_map(
|
|
|
return status;
|
|
|
}
|
|
|
|
|
|
-int efi_set_rtc_mmss(const struct timespec *now)
|
|
|
-{
|
|
|
- unsigned long nowtime = now->tv_sec;
|
|
|
- efi_status_t status;
|
|
|
- efi_time_t eft;
|
|
|
- efi_time_cap_t cap;
|
|
|
- struct rtc_time tm;
|
|
|
-
|
|
|
- status = efi.get_time(&eft, &cap);
|
|
|
- if (status != EFI_SUCCESS) {
|
|
|
- pr_err("Oops: efitime: can't read time!\n");
|
|
|
- return -1;
|
|
|
- }
|
|
|
-
|
|
|
- rtc_time_to_tm(nowtime, &tm);
|
|
|
- if (!rtc_valid_tm(&tm)) {
|
|
|
- eft.year = tm.tm_year + 1900;
|
|
|
- eft.month = tm.tm_mon + 1;
|
|
|
- eft.day = tm.tm_mday;
|
|
|
- eft.minute = tm.tm_min;
|
|
|
- eft.second = tm.tm_sec;
|
|
|
- eft.nanosecond = 0;
|
|
|
- } else {
|
|
|
- pr_err("%s: Invalid EFI RTC value: write of %lx to EFI RTC failed\n",
|
|
|
- __func__, nowtime);
|
|
|
- return -1;
|
|
|
- }
|
|
|
-
|
|
|
- status = efi.set_time(&eft);
|
|
|
- if (status != EFI_SUCCESS) {
|
|
|
- pr_err("Oops: efitime: can't write time!\n");
|
|
|
- return -1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
void efi_get_time(struct timespec *now)
|
|
|
{
|
|
|
efi_status_t status;
|