diff mbox

[RFC,2/3] arm64 linux loader: use grub_efi_find_config_table to find DT

Message ID 1456854103-12095-3-git-send-email-leif.lindholm@linaro.org
State New
Headers show

Commit Message

Leif Lindholm March 1, 2016, 5:41 p.m. UTC
Use new helper function rather than manually iterating through system
table.
---
 grub-core/loader/arm64/fdt.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

-- 
2.1.4


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
diff mbox

Patch

diff --git a/grub-core/loader/arm64/fdt.c b/grub-core/loader/arm64/fdt.c
index 5202c14..16222a4 100644
--- a/grub-core/loader/arm64/fdt.c
+++ b/grub-core/loader/arm64/fdt.c
@@ -31,23 +31,9 @@  static void *fdt;
 static void *
 get_firmware_fdt (void)
 {
-  grub_efi_configuration_table_t *tables;
   grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID;
-  void *firmware_fdt = NULL;
-  unsigned int i;
 
-  /* Look for FDT in UEFI config tables. */
-  tables = grub_efi_system_table->configuration_table;
-
-  for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
-    if (grub_memcmp (&tables[i].vendor_guid, &fdt_guid, sizeof (fdt_guid)) == 0)
-      {
-	firmware_fdt = tables[i].vendor_table;
-	grub_dprintf ("linux", "found registered FDT @ %p\n", firmware_fdt);
-	break;
-      }
-
-  return firmware_fdt;
+  return grub_efi_find_config_table (&fdt_guid);
 }
 
 void *