aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2019-05-19 21:41:28 +0200
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2019-05-24 18:58:13 +0200
commitbb2b13d52877c06f798600c848ddf1eb750ba85f (patch)
tree0de8592c830ff793b98e8a78ed6b1616c0b13f3b
parent433bfe7b122eab59ef54e435154f31407668f5b2 (diff)
downloadu-boot-bb2b13d52877c06f798600c848ddf1eb750ba85f.zip
u-boot-bb2b13d52877c06f798600c848ddf1eb750ba85f.tar.gz
u-boot-bb2b13d52877c06f798600c848ddf1eb750ba85f.tar.bz2
efi_loader: return values of GetTime()
According to the UEFI spec 2.8 the GetTime() runtime service should return EFI_UNSUPPORTED if the real time clock is not available. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
-rw-r--r--lib/efi_loader/efi_runtime.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c
index 8d1370b..058b40a 100644
--- a/lib/efi_loader/efi_runtime.c
+++ b/lib/efi_loader/efi_runtime.c
@@ -169,7 +169,6 @@ static efi_status_t EFIAPI efi_get_time_boottime(
{
#ifdef CONFIG_DM_RTC
efi_status_t ret = EFI_SUCCESS;
- int r;
struct rtc_time tm;
struct udevice *dev;
@@ -179,11 +178,12 @@ static efi_status_t EFIAPI efi_get_time_boottime(
ret = EFI_INVALID_PARAMETER;
goto out;
}
-
- r = uclass_get_device(UCLASS_RTC, 0, &dev);
- if (!r)
- r = dm_rtc_get(dev, &tm);
- if (r) {
+ if (uclass_get_device(UCLASS_RTC, 0, &dev) ||
+ dm_rtc_get(dev, &tm)) {
+ ret = EFI_UNSUPPORTED;
+ goto out;
+ }
+ if (dm_rtc_get(dev, &tm)) {
ret = EFI_DEVICE_ERROR;
goto out;
}
@@ -210,7 +210,7 @@ out:
return EFI_EXIT(ret);
#else
EFI_ENTRY("%p %p", time, capabilities);
- return EFI_EXIT(EFI_DEVICE_ERROR);
+ return EFI_EXIT(EFI_UNSUPPORTED);
#endif
}