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: Aswath Govindraju <a-govindraju@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
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)