Commit 2153a08a authored by Aswath Govindraju's avatar Aswath Govindraju Committed by Peng Fan
Browse files

mmc: Check for device with a seq number equal to num before checking against index



First check if there is an alias for the device tree node defined with the
given num before checking against device index.
Signed-off-by: default avatarAswath Govindraju <a-govindraju@ti.com>
Reviewed-by: Lokesh Vutla's avatarLokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Jaehoon Chung's avatarJaehoon Chung <jh80.chung@samsung.com>
parent 1fc9346a
......@@ -3052,9 +3052,11 @@ int mmc_init_device(int num)
struct mmc *m;
int ret;
ret = uclass_get_device(UCLASS_MMC, num, &dev);
if (ret)
return ret;
if (uclass_get_device_by_seq(UCLASS_MMC, num, &dev)) {
ret = uclass_get_device(UCLASS_MMC, num, &dev);
if (ret)
return ret;
}
m = mmc_get_mmc_dev(dev);
if (!m)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment