u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
To: Simon Glass <sjg@chromium.org>
Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>,
	u-boot@lists.denx.de,
	Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Subject: [PATCH 1/1] block: fix blk_get_devnum_by_typename()
Date: Tue,  2 Aug 2022 11:49:33 +0200	[thread overview]
Message-ID: <20220802094933.69170-1-heinrich.schuchardt@canonical.com> (raw)

Both the 'host' and the 'efiloader' block devices use the same parent
uclass root. Thus the parent uclass is not an indicator the interface type.

Currently the following fails:

    setenv efi_selftest block device
    bootefi selftest
    part list efiloader 0

Struct blk_desc contains the interface type. So we can check it directly
without caring about the parent uclass.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 drivers/block/blk-uclass.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c
index 21c5209bb6..779cda7834 100644
--- a/drivers/block/blk-uclass.c
+++ b/drivers/block/blk-uclass.c
@@ -122,15 +122,11 @@ struct blk_desc *blk_get_devnum_by_typename(const char *if_typename, int devnum)
 
 		debug("%s: if_type=%d, devnum=%d: %s, %d, %d\n", __func__,
 		      if_type, devnum, dev->name, desc->if_type, desc->devnum);
-		if (desc->devnum != devnum)
-			continue;
 
-		/* Find out the parent device uclass */
-		if (device_get_uclass_id(dev->parent) != uclass_id) {
-			debug("%s: parent uclass %d, this dev %d\n", __func__,
-			      device_get_uclass_id(dev->parent), uclass_id);
+		if (desc->if_type != if_type)
+			continue;
+		if (desc->devnum != devnum)
 			continue;
-		}
 
 		if (device_probe(dev))
 			return NULL;
-- 
2.36.1


             reply	other threads:[~2022-08-02  9:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02  9:49 Heinrich Schuchardt [this message]
2022-08-02 12:41 ` [PATCH 1/1] block: fix blk_get_devnum_by_typename() Simon Glass
2022-08-02 16:22   ` Heinrich Schuchardt
2022-08-03 18:14     ` Simon Glass
2022-08-04  6:06       ` Heinrich Schuchardt
2022-08-07 15:48         ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220802094933.69170-1-heinrich.schuchardt@canonical.com \
    --to=heinrich.schuchardt@canonical.com \
    --cc=sjg@chromium.org \
    --cc=takahiro.akashi@linaro.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).