[U-Boot] [PATCH] mmc-uclass: correct the device number
Kever Yang
kever.yang at rock-chips.com
Mon Jul 18 11:52:57 CEST 2016
The devnum in is start from 0, so the device number should be
(devnum+1).
Signed-off-by: Kever Yang <kever.yang at rock-chips.com>
---
drivers/mmc/mmc-uclass.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index 38ced41..7c40d24 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -111,7 +111,7 @@ struct mmc *find_mmc_device(int dev_num)
int get_mmc_num(void)
{
- return max(blk_find_max_devnum(IF_TYPE_MMC), 0);
+ return max((blk_find_max_devnum(IF_TYPE_MMC)+1), 0);
}
int mmc_get_next_devnum(void)
--
1.9.1
More information about the U-Boot
mailing list