1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00

mmc-uclass: correct the device number

Not like the mmc-legacy which the devnum starts from 1, it starts from 0
in mmc-uclass, so the device number should be (devnum + 1) in get_mmc_num().

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
This commit is contained in:
Kever Yang
2016-07-22 17:22:50 +08:00
committed by Simon Glass
parent 5c928d0204
commit 46683f3da1
2 changed files with 9 additions and 3 deletions

View File

@@ -111,18 +111,18 @@ 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)
{
int ret;
ret = get_mmc_num();
ret = blk_find_max_devnum(IF_TYPE_MMC);
if (ret < 0)
return ret;
return ret + 1;
return ret;
}
struct blk_desc *mmc_get_blk_desc(struct mmc *mmc)