aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc/mmc-uclass.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/mmc-uclass.c')
-rw-r--r--drivers/mmc/mmc-uclass.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index c9b6364260e..16cc91ebdfd 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -260,13 +260,18 @@ static int mmc_select_hwpart(struct udevice *bdev, int hwpart)
static int mmc_blk_probe(struct udevice *dev)
{
- struct blk_desc *block_dev = dev_get_uclass_platdata(dev);
- int dev_num = block_dev->devnum;
- struct mmc *mmc = find_mmc_device(dev_num);
+ struct udevice *mmc_dev = dev_get_parent(dev);
+ struct mmc_uclass_priv *upriv = dev_get_uclass_priv(mmc_dev);
+ struct mmc *mmc = upriv->mmc;
+ int ret;
+
+ ret = mmc_init(mmc);
+ if (ret) {
+ debug("%s: mmc_init() failed (err=%d)\n", __func__, ret);
+ return ret;
+ }
- if (!mmc)
- return -ENODEV;
- return mmc_init(mmc);
+ return 0;
}
static const struct blk_ops mmc_blk_ops = {