graphics: Do not require nonstandard console control protocol
authorJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Wed, 15 Jan 2014 11:08:04 +0000 (11:08 +0000)
committerTom Gundersen <teg@jklm.no>
Wed, 15 Jan 2014 11:15:35 +0000 (12:15 +0100)
Console Control Protocol is a nonstandard UEFI interface and lack of
it shall not be treated as an error.

Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
src/efi/graphics.c

index 062ce27..c85daa3 100644 (file)
@@ -67,8 +67,10 @@ EFI_STATUS graphics_mode(BOOLEAN on) {
         EFI_STATUS err;
 
         err = LibLocateProtocol(&ConsoleControlProtocolGuid, (VOID **)&ConsoleControl);
-        if (EFI_ERROR(err))
-                return err;
+        if (EFI_ERROR(err)) {
+                /* console control protocol is nonstandard and might not exist. */
+                return err == EFI_NOT_FOUND ? EFI_SUCCESS : err;
+        }
 
         /* check current mode */
         err = uefi_call_wrapper(ConsoleControl->GetMode, 4, ConsoleControl, &current, &uga_exists, &stdin_locked);