aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/mmc/host/sdhci-pltfm.c
diff options
context:
space:
mode:
authorChristian Daudt <csd@broadcom.com>2013-05-29 13:50:05 -0700
committerChris Ball <cjb@laptop.org>2013-05-31 11:59:29 -0400
commit0e748234293f5f2caa8dbd152caba5efb754c707 (patch)
treed264cb090be41c375de32707478036f2374eb543 /drivers/mmc/host/sdhci-pltfm.c
parentmmc: sdhci-pci: support runtime PM for BYT SD cards (diff)
downloadwireguard-linux-0e748234293f5f2caa8dbd152caba5efb754c707.tar.xz
wireguard-linux-0e748234293f5f2caa8dbd152caba5efb754c707.zip
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) {}
EXPORT_SYMBOL_GPL(sdhci_get_of_property);
struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
- const struct sdhci_pltfm_data *pdata)
+ const struct sdhci_pltfm_data *pdata,
+ size_t priv_size)
{
struct sdhci_host *host;
- struct sdhci_pltfm_host *pltfm_host;
struct device_node *np = pdev->dev.of_node;
struct resource *iomem;
int ret;
@@ -134,17 +134,17 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
/* Some PCI-based MFD need the parent here */
if (pdev->dev.parent != &platform_bus && !np)
- host = sdhci_alloc_host(pdev->dev.parent, sizeof(*pltfm_host));
+ host = sdhci_alloc_host(pdev->dev.parent,
+ sizeof(struct sdhci_pltfm_host) + priv_size);
else
- host = sdhci_alloc_host(&pdev->dev, sizeof(*pltfm_host));
+ host = sdhci_alloc_host(&pdev->dev,
+ sizeof(struct sdhci_pltfm_host) + priv_size);
if (IS_ERR(host)) {
ret = PTR_ERR(host);
goto err;
}
- pltfm_host = sdhci_priv(host);
-
host->hw_name = dev_name(&pdev->dev);
if (pdata && pdata->ops)
host->ops = pdata->ops;
@@ -204,12 +204,13 @@ void sdhci_pltfm_free(struct platform_device *pdev)
EXPORT_SYMBOL_GPL(sdhci_pltfm_free);
int sdhci_pltfm_register(struct platform_device *pdev,
- const struct sdhci_pltfm_data *pdata)
+ const struct sdhci_pltfm_data *pdata,
+ size_t priv_size)
{
struct sdhci_host *host;
int ret = 0;
- host = sdhci_pltfm_init(pdev, pdata);
+ host = sdhci_pltfm_init(pdev, pdata, priv_size);
if (IS_ERR(host))
return PTR_ERR(host);