1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-25 06:03:40 +03:00

boot: Drop use of DevicePathFromHandle

This commit is contained in:
Jan Janssen 2022-05-26 13:07:30 +02:00
parent 6a261332bc
commit 5594ebee99
2 changed files with 10 additions and 7 deletions

View 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)) {

View 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;