diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2021-12-09 12:33:06 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-12-13 23:37:32 +0100 |
commit | 28ec04c5922ceab115d42a9bb50b7e812c0fed89 (patch) | |
tree | 1f294d6610e9ca5847a06e56b877ea565d21797c /common/efi | |
parent | 8d57841159f967d5d63553b65444697412a43f9b (diff) | |
download | barebox-28ec04c5922ceab115d42a9bb50b7e812c0fed89.tar.gz barebox-28ec04c5922ceab115d42a9bb50b7e812c0fed89.tar.xz |
efi: Implement device_path_to_subtype()
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/efi')
-rw-r--r-- | common/efi/devicepath.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/common/efi/devicepath.c b/common/efi/devicepath.c index 8b9dfbf434..584f1fbd1d 100644 --- a/common/efi/devicepath.c +++ b/common/efi/devicepath.c @@ -784,6 +784,21 @@ u8 device_path_to_type(struct efi_device_path *dev_path) return device_path_type(dev_path); } +u8 device_path_to_subtype(struct efi_device_path *dev_path) +{ + struct efi_device_path *dev_path_next; + + dev_path = unpack_device_path(dev_path); + dev_path_next = next_device_path_node(dev_path); + + while (!is_device_path_end(dev_path_next)) { + dev_path = dev_path_next; + dev_path_next = next_device_path_node(dev_path); + } + + return dev_path->sub_type; +} + char *device_path_to_partuuid(struct efi_device_path *dev_path) { struct efi_device_path *dev_path_node; |