Commit 4ea580f1 authored by Rabin Vincent's avatar Rabin Vincent Committed by Pierre Ossman

mmci: fix crash with debug enabled

If MMC debugging is enabled, the mmci driver oopses because the DBG
macro uses host->mmc before it is set.  Set it earlier.
Signed-off-by: default avatarRabin Vincent <rabin@rab.in>
Signed-off-by: default avatarPierre Ossman <pierre@ossman.eu>
parent 4accfe25
...@@ -514,6 +514,7 @@ static int __devinit mmci_probe(struct amba_device *dev, void *id) ...@@ -514,6 +514,7 @@ static int __devinit mmci_probe(struct amba_device *dev, void *id)
} }
host = mmc_priv(mmc); host = mmc_priv(mmc);
host->mmc = mmc;
/* Bits 12 thru 19 is the designer */ /* Bits 12 thru 19 is the designer */
host->hw_designer = (dev->periphid >> 12) & 0xff; host->hw_designer = (dev->periphid >> 12) & 0xff;
/* Bits 20 thru 23 is the revison */ /* Bits 20 thru 23 is the revison */
...@@ -545,7 +546,6 @@ static int __devinit mmci_probe(struct amba_device *dev, void *id) ...@@ -545,7 +546,6 @@ static int __devinit mmci_probe(struct amba_device *dev, void *id)
host->mclk = clk_get_rate(host->clk); host->mclk = clk_get_rate(host->clk);
DBG(host, "eventual mclk rate: %u Hz\n", host->mclk); DBG(host, "eventual mclk rate: %u Hz\n", host->mclk);
} }
host->mmc = mmc;
host->base = ioremap(dev->res.start, SZ_4K); host->base = ioremap(dev->res.start, SZ_4K);
if (!host->base) { if (!host->base) {
ret = -ENOMEM; ret = -ENOMEM;
......
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