]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: Drop use of DevicePathFromHandle
authorJan Janssen <medhefgo@web.de>
Thu, 26 May 2022 11:07:30 +0000 (13:07 +0200)
committerJan Janssen <medhefgo@web.de>
Thu, 9 Jun 2022 10:50:13 +0000 (12:50 +0200)
src/boot/efi/disk.c
src/boot/efi/xbootldr.c

index b7beac3d08b9683b2b230c3bdbbc748c7c7b8f6b..fcd5812ff16bca3a34fc65bab8ac1bbc8cff5dcb 100644 (file)
@@ -7,16 +7,18 @@
 #include "util.h"
 
 EFI_STATUS disk_get_part_uuid(EFI_HANDLE *handle, CHAR16 uuid[static 37]) {
+        EFI_STATUS err;
         EFI_DEVICE_PATH *device_path;
         _cleanup_freepool_ EFI_DEVICE_PATH *paths = NULL;
 
+        /* export the device path this image is started from */
+
         if (!handle)
                 return EFI_NOT_FOUND;
 
-        /* export the device path this image is started from */
-        device_path = DevicePathFromHandle(handle);
-        if (!device_path)
-                return EFI_NOT_FOUND;
+        err = BS->HandleProtocol(handle, &DevicePathProtocol, (void **) &device_path);
+        if (err != EFI_SUCCESS)
+                return err;
 
         paths = UnpackDevicePath(device_path);
         for (EFI_DEVICE_PATH *path = paths; !IsDevicePathEnd(path); path = NextDevicePathNode(path)) {
index 583bc4216fd8b5c813b6df1f9991521018c7159a..84e443135c3846c1ceb2832d25cd0b626b1be7fa 100644 (file)
@@ -154,9 +154,10 @@ static EFI_STATUS find_device(EFI_HANDLE *device, EFI_DEVICE_PATH **ret_device_p
         assert(device);
         assert(ret_device_path);
 
-        EFI_DEVICE_PATH *partition_path = DevicePathFromHandle(device);
-        if (!partition_path)
-                return EFI_NOT_FOUND;
+        EFI_DEVICE_PATH *partition_path;
+        err = BS->HandleProtocol(device, &DevicePathProtocol, (void **) &partition_path);
+        if (err != EFI_SUCCESS)
+                return err;
 
         /* Find the (last) partition node itself. */
         EFI_DEVICE_PATH *part_node = NULL;