aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/sunxi/patches-3.13/170-6-mmc-dont-call-mmc_of_parser-until-ready.patch
blob: 21aee136c513bcd135036a6d2374135251216e8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 73797537f3904fec60a647b3b209bf7add092ad5 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 17 Feb 2014 21:59:08 +0100
Subject: [PATCH] sunxi-mmc: Don't call mmc_of_parse until we're ready to

mmc_of_parse registers an irq handler for the gpio pins for cd, this irq
handler will reference host->ops, so don't call mmc_of_parse until we're
done setting everything up.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/mmc/host/sunxi-mmc.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index d5e8ff9..cceae68 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -766,10 +766,6 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
-	ret = mmc_of_parse(mmc);
-	if (ret)
-		goto error_free_host;
-
 	host = mmc_priv(mmc);
 	host->mmc = mmc;
 	spin_lock_init(&host->lock);
@@ -806,8 +802,11 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
 		     MMC_CAP_SDIO_IRQ;
 	mmc->caps2 |= MMC_CAP2_NO_PRESCAN_POWERUP;
 
-	ret = mmc_add_host(mmc);
+	ret = mmc_of_parse(mmc);
+	if (ret)
+		goto error_free_dma;
 
+	ret = mmc_add_host(mmc);
 	if (ret)
 		goto error_free_dma;
 
-- 
1.8.5.5