aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2015-03-04 10:30:07 -0500
committerUlf Hansson <ulf.hansson@linaro.org>2015-03-23 09:13:46 -0400
commit03a6d291047da60d56514c28fa1314235bdf2037 (patch)
tree8323f46001c42eb14828eb32a877018db79d8883 /drivers/mmc/host
parentbbd7f0a20f76d079199d6d749cb3da07d345bae3 (diff)
mmc: sdhci-spear: Remove exported header
Move the member for card_int_gpio into the struct spear_sdhci. In this way we eliminate the last user of the struct sdhci_plat_data, which enables us to remove the exported header for sdhci-spear. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r--drivers/mmc/host/sdhci-spear.c35
1 files changed, 9 insertions, 26 deletions
diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
index f482f7f677e5..df088343d60f 100644
--- a/drivers/mmc/host/sdhci-spear.c
+++ b/drivers/mmc/host/sdhci-spear.c
@@ -26,14 +26,13 @@
26#include <linux/pm.h> 26#include <linux/pm.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/mmc/host.h> 28#include <linux/mmc/host.h>
29#include <linux/mmc/sdhci-spear.h>
30#include <linux/mmc/slot-gpio.h> 29#include <linux/mmc/slot-gpio.h>
31#include <linux/io.h> 30#include <linux/io.h>
32#include "sdhci.h" 31#include "sdhci.h"
33 32
34struct spear_sdhci { 33struct spear_sdhci {
35 struct clk *clk; 34 struct clk *clk;
36 struct sdhci_plat_data *data; 35 int card_int_gpio;
37}; 36};
38 37
39/* sdhci ops */ 38/* sdhci ops */
@@ -44,26 +43,16 @@ static const struct sdhci_ops sdhci_pltfm_ops = {
44 .set_uhs_signaling = sdhci_set_uhs_signaling, 43 .set_uhs_signaling = sdhci_set_uhs_signaling,
45}; 44};
46 45
47static struct sdhci_plat_data *sdhci_probe_config_dt(struct platform_device *pdev) 46static void sdhci_probe_config_dt(struct device_node *np,
47 struct spear_sdhci *host)
48{ 48{
49 struct device_node *np = pdev->dev.of_node;
50 struct sdhci_plat_data *pdata = NULL;
51 int cd_gpio; 49 int cd_gpio;
52 50
53 cd_gpio = of_get_named_gpio(np, "cd-gpios", 0); 51 cd_gpio = of_get_named_gpio(np, "cd-gpios", 0);
54 if (!gpio_is_valid(cd_gpio)) 52 if (!gpio_is_valid(cd_gpio))
55 cd_gpio = -1; 53 cd_gpio = -1;
56 54
57 /* If pdata is required */ 55 host->card_int_gpio = cd_gpio;
58 if (cd_gpio != -1) {
59 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
60 if (!pdata)
61 dev_err(&pdev->dev, "DT: kzalloc failed\n");
62 else
63 pdata->card_int_gpio = cd_gpio;
64 }
65
66 return pdata;
67} 56}
68 57
69static int sdhci_probe(struct platform_device *pdev) 58static int sdhci_probe(struct platform_device *pdev)
@@ -116,24 +105,18 @@ static int sdhci_probe(struct platform_device *pdev)
116 dev_dbg(&pdev->dev, "Error setting desired clk, clk=%lu\n", 105 dev_dbg(&pdev->dev, "Error setting desired clk, clk=%lu\n",
117 clk_get_rate(sdhci->clk)); 106 clk_get_rate(sdhci->clk));
118 107
119 sdhci->data = sdhci_probe_config_dt(pdev); 108 sdhci_probe_config_dt(pdev->dev.of_node, sdhci);
120 if (IS_ERR(sdhci->data)) {
121 dev_err(&pdev->dev, "DT: Failed to get pdata\n");
122 goto disable_clk;
123 }
124
125 /* 109 /*
126 * It is optional to use GPIOs for sdhci card detection. If 110 * It is optional to use GPIOs for sdhci card detection. If
127 * sdhci->data is NULL, then use original sdhci lines otherwise 111 * sdhci->card_int_gpio < 0, then use original sdhci lines otherwise
128 * GPIO lines. We use the built-in GPIO support for this. 112 * GPIO lines. We use the built-in GPIO support for this.
129 */ 113 */
130 if (sdhci->data && sdhci->data->card_int_gpio >= 0) { 114 if (sdhci->card_int_gpio >= 0) {
131 ret = mmc_gpio_request_cd(host->mmc, 115 ret = mmc_gpio_request_cd(host->mmc, sdhci->card_int_gpio, 0);
132 sdhci->data->card_int_gpio, 0);
133 if (ret < 0) { 116 if (ret < 0) {
134 dev_dbg(&pdev->dev, 117 dev_dbg(&pdev->dev,
135 "failed to request card-detect gpio%d\n", 118 "failed to request card-detect gpio%d\n",
136 sdhci->data->card_int_gpio); 119 sdhci->card_int_gpio);
137 goto disable_clk; 120 goto disable_clk;
138 } 121 }
139 } 122 }