aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-01-29 14:58:39 -0700
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-02-05 20:20:01 +0100
commite2bceb03312a8abfb4f423ac349ab5861feb3548 (patch)
tree30392481d7c33addcf17ea0f126e29d49af765b3 /lib
parent377d39d178570a3510a34aac61f008b43cca783f (diff)
downloadu-boot-e2bceb03312a8abfb4f423ac349ab5861feb3548.zip
u-boot-e2bceb03312a8abfb4f423ac349ab5861feb3548.tar.gz
u-boot-e2bceb03312a8abfb4f423ac349ab5861feb3548.tar.bz2
efi: Drop unnecessary calls to blk_find_device()
When we have the block descriptor we can simply access the device. Drop the unnecessary function call. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_device_path.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index 75ab4de..dc787b4 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -769,13 +769,8 @@ __maybe_unused static void *dp_fill(void *buf, struct udevice *dev)
static unsigned dp_part_size(struct blk_desc *desc, int part)
{
unsigned dpsize;
- struct udevice *dev;
- int ret;
+ struct udevice *dev = desc->bdev;
- ret = blk_find_device(desc->if_type, desc->devnum, &dev);
-
- if (ret)
- dev = desc->bdev->parent;
dpsize = dp_size(dev);
if (part == 0) /* the actual disk, not a partition */
@@ -866,13 +861,8 @@ static void *dp_part_node(void *buf, struct blk_desc *desc, int part)
*/
static void *dp_part_fill(void *buf, struct blk_desc *desc, int part)
{
- struct udevice *dev;
- int ret;
-
- ret = blk_find_device(desc->if_type, desc->devnum, &dev);
+ struct udevice *dev = desc->bdev;
- if (ret)
- dev = desc->bdev->parent;
buf = dp_fill(buf, dev);
if (part == 0) /* the actual disk, not a partition */