[U-Boot] [PATCH] blk: Check if_type in blk_get_devnum_by_typename

Juha Sarlin jsub at sarlin.mobi
Sun Nov 24 18:09:30 UTC 2019


While searching for a BLK device, this function checks only for a
matching devnum. It should check if_type, too.

Signed-off-by: Juha Sarlin <jsub at sarlin.mobi>
---

 drivers/block/blk-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c
index ca8978f0e1..78f2bcab09 100644
--- a/drivers/block/blk-uclass.c
+++ b/drivers/block/blk-uclass.c
@@ -112,7 +112,7 @@ 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)
+		if (desc->if_type != if_type || desc->devnum != devnum)
 			continue;
 
 		/* Find out the parent device uclass */
-- 
2.20.1.98.gecbdaf0899



More information about the U-Boot mailing list