Commit 8e0a22e2 authored by Arvind Sankar's avatar Arvind Sankar Committed by Ard Biesheuvel
Browse files

efi/gop: Slightly re-arrange logic of find_gop

parent ecf53091
Loading
Loading
Loading
Loading
+13 −17
Original line number Diff line number Diff line
@@ -99,7 +99,6 @@ find_gop(efi_guid_t *proto, unsigned long size, void **handles)

	for_each_efi_handle(h, handles, size, i) {
		efi_guid_t conout_proto = EFI_CONSOLE_OUT_DEVICE_GUID;
		bool conout_found = false;
		void *dummy = NULL;

		status = efi_bs_call(handle_protocol, h, proto, (void **)&gop);
@@ -111,11 +110,6 @@ find_gop(efi_guid_t *proto, unsigned long size, void **handles)
		if (info->pixel_format == PIXEL_BLT_ONLY)
			continue;

		status = efi_bs_call(handle_protocol, h, &conout_proto, &dummy);
		if (status == EFI_SUCCESS)
			conout_found = true;

		if (!first_gop || conout_found) {
		/*
		 * Systems that use the UEFI Console Splitter may
		 * provide multiple GOP devices, not all of which are
@@ -126,10 +120,12 @@ find_gop(efi_guid_t *proto, unsigned long size, void **handles)
		 * Once we've found a GOP supporting ConOut,
		 * don't bother looking any further.
		 */
		status = efi_bs_call(handle_protocol, h, &conout_proto, &dummy);
		if (status == EFI_SUCCESS)
			return gop;

		if (!first_gop)
			first_gop = gop;
			if (conout_found)
				break;
		}
	}

	return first_gop;