aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci-pltfm.c
diff options
context:
space:
mode:
authorChristian Daudt <csd@broadcom.com>2013-05-29 16:50:05 -0400
committerChris Ball <cjb@laptop.org>2013-05-31 11:59:29 -0400
commit0e748234293f5f2caa8dbd152caba5efb754c707 (patch)
treed264cb090be41c375de32707478036f2374eb543 /drivers/mmc/host/sdhci-pltfm.c
parent7396e318b497cd46eb156effa5278126582ddde7 (diff)
mmc: sdhci: Add size for caller in init+register
Add a param to allow users of sdhci_pltfm to allocate private space in calls to sdhci_pltfm_init+sdhci_pltfm_register. This is implemented in the same way as sdhci does for its users. None of the users have been migrated yet and are passing in zero to retain their private allocation. - todo: migrate clients to using allocation this way - todo: remove priv variable once migration is complete Also removed unused variable in sdhci_pltfm_init fn Signed-off-by: Christian Daudt <csd@broadcom.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-pltfm.c')
-rw-r--r--drivers/mmc/host/sdhci-pltfm.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index e7762e5e9048..e2065a44dffc 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -115,10 +115,10 @@ void sdhci_get_of_property(struct platform_device *pdev) {}
115EXPORT_SYMBOL_GPL(sdhci_get_of_property); 115EXPORT_SYMBOL_GPL(sdhci_get_of_property);
116 116
117struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, 117struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
118 const struct sdhci_pltfm_data *pdata) 118 const struct sdhci_pltfm_data *pdata,
119 size_t priv_size)
119{ 120{
120 struct sdhci_host *host; 121 struct sdhci_host *host;
121 struct sdhci_pltfm_host *pltfm_host;
122 struct device_node *np = pdev->dev.of_node; 122 struct device_node *np = pdev->dev.of_node;
123 struct resource *iomem; 123 struct resource *iomem;
124 int ret; 124 int ret;
@@ -134,17 +134,17 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
134 134
135 /* Some PCI-based MFD need the parent here */ 135 /* Some PCI-based MFD need the parent here */
136 if (pdev->dev.parent != &platform_bus && !np) 136 if (pdev->dev.parent != &platform_bus && !np)
137 host = sdhci_alloc_host(pdev->dev.parent, sizeof(*pltfm_host)); 137 host = sdhci_alloc_host(pdev->dev.parent,
138 sizeof(struct sdhci_pltfm_host) + priv_size);
138 else 139 else
139 host = sdhci_alloc_host(&pdev->dev, sizeof(*pltfm_host)); 140 host = sdhci_alloc_host(&pdev->dev,
141 sizeof(struct sdhci_pltfm_host) + priv_size);
140 142
141 if (IS_ERR(host)) { 143 if (IS_ERR(host)) {
142 ret = PTR_ERR(host); 144 ret = PTR_ERR(host);
143 goto err; 145 goto err;
144 } 146 }
145 147
146 pltfm_host = sdhci_priv(host);
147
148 host->hw_name = dev_name(&pdev->dev); 148 host->hw_name = dev_name(&pdev->dev);
149 if (pdata && pdata->ops) 149 if (pdata && pdata->ops)
150 host->ops = pdata->ops; 150 host->ops = pdata->ops;
@@ -204,12 +204,13 @@ void sdhci_pltfm_free(struct platform_device *pdev)
204EXPORT_SYMBOL_GPL(sdhci_pltfm_free); 204EXPORT_SYMBOL_GPL(sdhci_pltfm_free);
205 205
206int sdhci_pltfm_register(struct platform_device *pdev, 206int sdhci_pltfm_register(struct platform_device *pdev,
207 const struct sdhci_pltfm_data *pdata) 207 const struct sdhci_pltfm_data *pdata,
208 size_t priv_size)
208{ 209{
209 struct sdhci_host *host; 210 struct sdhci_host *host;
210 int ret = 0; 211 int ret = 0;
211 212
212 host = sdhci_pltfm_init(pdev, pdata); 213 host = sdhci_pltfm_init(pdev, pdata, priv_size);
213 if (IS_ERR(host)) 214 if (IS_ERR(host))
214 return PTR_ERR(host); 215 return PTR_ERR(host);
215 216