]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: sdhci: Fix sdhci mmc driver probe abort
authorKever Yang <kever.yang@rock-chips.com>
Fri, 19 Jul 2019 10:01:11 +0000 (18:01 +0800)
committerKever Yang <kever.yang@rock-chips.com>
Sat, 20 Jul 2019 15:59:44 +0000 (23:59 +0800)
This patch fix mmc driver abort caused by below patch:
3d296365e4 mmc: sdhci: Add support for sdhci-caps-mask

After the patch sdhci_setup_cfg() access to host->mmc->dev,
so we have to do init before make the call to the function()

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
drivers/mmc/rockchip_sdhci.c

index cb623d589b497ee3057aa53e47f3c1c6de72f58f..dd3d5574dbc74dd5f46baae1d1f7d912983e074d 100644 (file)
@@ -68,15 +68,15 @@ static int arasan_sdhci_probe(struct udevice *dev)
        if (host->bus_width == 8)
                host->host_caps |= MMC_MODE_8BIT;
 
-       ret = sdhci_setup_cfg(&plat->cfg, host, 0, EMMC_MIN_FREQ);
-
        host->mmc = &plat->mmc;
-       if (ret)
-               return ret;
        host->mmc->priv = &prv->host;
        host->mmc->dev = dev;
        upriv->mmc = host->mmc;
 
+       ret = sdhci_setup_cfg(&plat->cfg, host, 0, EMMC_MIN_FREQ);
+       if (ret)
+               return ret;
+
        return sdhci_probe(dev);
 }