Skip to content
Snippets Groups Projects
Commit 2bc61b83 authored by Heinrich Schuchardt's avatar Heinrich Schuchardt Committed by Alexander Graf
Browse files

efi_loader: create full device path for block devices


When creating the device path of a block device it has to
comprise the block device itself and should not end at
its parent.

Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent 485c13c7
No related branches found
No related tags found
No related merge requests found
...@@ -383,7 +383,14 @@ static unsigned dp_part_size(struct blk_desc *desc, int part) ...@@ -383,7 +383,14 @@ static unsigned dp_part_size(struct blk_desc *desc, int part)
unsigned dpsize; unsigned dpsize;
#ifdef CONFIG_BLK #ifdef CONFIG_BLK
dpsize = dp_size(desc->bdev->parent); {
struct udevice *dev;
int ret = blk_find_device(desc->if_type, desc->devnum, &dev);
if (ret)
dev = desc->bdev->parent;
dpsize = dp_size(dev);
}
#else #else
dpsize = sizeof(ROOT) + sizeof(struct efi_device_path_usb); dpsize = sizeof(ROOT) + sizeof(struct efi_device_path_usb);
#endif #endif
...@@ -411,7 +418,14 @@ static void *dp_part_fill(void *buf, struct blk_desc *desc, int part) ...@@ -411,7 +418,14 @@ static void *dp_part_fill(void *buf, struct blk_desc *desc, int part)
disk_partition_t info; disk_partition_t info;
#ifdef CONFIG_BLK #ifdef CONFIG_BLK
buf = dp_fill(buf, desc->bdev->parent); {
struct udevice *dev;
int ret = blk_find_device(desc->if_type, desc->devnum, &dev);
if (ret)
dev = desc->bdev->parent;
buf = dp_fill(buf, dev);
}
#else #else
/* /*
* We *could* make a more accurate path, by looking at if_type * We *could* make a more accurate path, by looking at if_type
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment