diff mbox series

[U-Boot] rockchip: sdhci: Fix sdhci mmc driver probe abort

Message ID 20190719100830.17435-1-kever.yang@rock-chips.com
State Accepted
Commit 4dcdc5c159f595e27cbaae55569d514bb692d739
Delegated to: Kever Yang
Headers show
Series [U-Boot] rockchip: sdhci: Fix sdhci mmc driver probe abort | expand

Commit Message

Kever Yang July 19, 2019, 10:08 a.m. UTC
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 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Jagan Teki July 19, 2019, 3:04 p.m. UTC | #1
On Fri, Jul 19, 2019 at 3:38 PM Kever Yang <kever.yang@rock-chips.com> wrote:
>
> 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>
> ---

Tested-by: Jagan Teki <jagan@amarulasolutions.com> # Rockpro64,
NanoPi-NE04/M4, NanoPC-T4, OrangePI
Kever Yang July 23, 2019, 8:03 a.m. UTC | #2
On 2019/7/19 下午11:04, Jagan Teki wrote:
> On Fri, Jul 19, 2019 at 3:38 PM Kever Yang <kever.yang@rock-chips.com> wrote:
>> 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>
>> ---
> Tested-by: Jagan Teki <jagan@amarulasolutions.com> # Rockpro64,
> NanoPi-NE04/M4, NanoPC-T4, OrangePI
>

Applied to u-boot-rockchip, thanks!
diff mbox series

Patch

diff --git a/drivers/mmc/rockchip_sdhci.c b/drivers/mmc/rockchip_sdhci.c
index cb623d589b..dd3d5574db 100644
--- a/drivers/mmc/rockchip_sdhci.c
+++ b/drivers/mmc/rockchip_sdhci.c
@@ -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);
 }