From: Heinrich Schuchardt Date: Mon, 11 Dec 2017 11:56:43 +0000 (+0100) Subject: efi_loader: create full device path for block devices X-Git-Tag: v2018.03-rc1~101^2~50 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2bc61b83522b021113028ee19bf4f2a460be4b44;p=u-boot 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: Heinrich Schuchardt Signed-off-by: Alexander Graf --- diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index ccb59337f1..3974fcc624 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -383,7 +383,14 @@ static unsigned dp_part_size(struct blk_desc *desc, int part) unsigned dpsize; #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 dpsize = sizeof(ROOT) + sizeof(struct efi_device_path_usb); #endif @@ -411,7 +418,14 @@ static void *dp_part_fill(void *buf, struct blk_desc *desc, int part) disk_partition_t info; #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 /* * We *could* make a more accurate path, by looking at if_type