summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorKever Yang <kever.yang@rock-chips.com>2016-07-22 17:22:50 +0800
committerSimon Glass <sjg@chromium.org>2016-07-31 07:24:20 -0600
commit46683f3da191a4c2156d5473c23b9923c461912c (patch)
tree215fabaa1e45e5bbc1f8e1766c2c152f63445696 /drivers/mmc
parent5c928d02044345b843202f23540c3765468c1d6f (diff)
downloadu-boot-imx-46683f3da191a4c2156d5473c23b9923c461912c.zip
u-boot-imx-46683f3da191a4c2156d5473c23b9923c461912c.tar.gz
u-boot-imx-46683f3da191a4c2156d5473c23b9923c461912c.tar.bz2
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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/mmc-uclass.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index 38ced41..f262c6e 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -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)