Commit f599da40 authored by Jisheng Zhang's avatar Jisheng Zhang Committed by Ulf Hansson

mmc: sdhci-pxav3: use sdhci_pltfm_init for private allocation

Commit 0e748234 ("mmc: sdhci: Add size for caller in init+register")
allows users of sdhci_pltfm to allocate private space in calls to
sdhci_pltfm_init+sdhci_pltfm_register. This patch migrates sdhci-pxav3
to this allocation.
Signed-off-by: default avatarJisheng Zhang <jszhang@marvell.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 8605e7ae
...@@ -132,7 +132,7 @@ static int armada_38x_quirks(struct platform_device *pdev, ...@@ -132,7 +132,7 @@ static int armada_38x_quirks(struct platform_device *pdev,
{ {
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct sdhci_pxa *pxa = pltfm_host->priv; struct sdhci_pxa *pxa = sdhci_pltfm_priv(pltfm_host);
struct resource *res; struct resource *res;
host->quirks &= ~SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN; host->quirks &= ~SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN;
...@@ -203,7 +203,7 @@ static void pxav3_reset(struct sdhci_host *host, u8 mask) ...@@ -203,7 +203,7 @@ static void pxav3_reset(struct sdhci_host *host, u8 mask)
static void pxav3_gen_init_74_clocks(struct sdhci_host *host, u8 power_mode) static void pxav3_gen_init_74_clocks(struct sdhci_host *host, u8 power_mode)
{ {
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct sdhci_pxa *pxa = pltfm_host->priv; struct sdhci_pxa *pxa = sdhci_pltfm_priv(pltfm_host);
u16 tmp; u16 tmp;
int count; int count;
...@@ -252,7 +252,7 @@ static void pxav3_gen_init_74_clocks(struct sdhci_host *host, u8 power_mode) ...@@ -252,7 +252,7 @@ static void pxav3_gen_init_74_clocks(struct sdhci_host *host, u8 power_mode)
static void pxav3_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs) static void pxav3_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs)
{ {
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct sdhci_pxa *pxa = pltfm_host->priv; struct sdhci_pxa *pxa = sdhci_pltfm_priv(pltfm_host);
u16 ctrl_2; u16 ctrl_2;
/* /*
...@@ -372,16 +372,12 @@ static int sdhci_pxav3_probe(struct platform_device *pdev) ...@@ -372,16 +372,12 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
const struct of_device_id *match; const struct of_device_id *match;
int ret; int ret;
pxa = devm_kzalloc(&pdev->dev, sizeof(struct sdhci_pxa), GFP_KERNEL); host = sdhci_pltfm_init(pdev, &sdhci_pxav3_pdata, sizeof(*pxa));
if (!pxa)
return -ENOMEM;
host = sdhci_pltfm_init(pdev, &sdhci_pxav3_pdata, 0);
if (IS_ERR(host)) if (IS_ERR(host))
return PTR_ERR(host); return PTR_ERR(host);
pltfm_host = sdhci_priv(host); pltfm_host = sdhci_priv(host);
pltfm_host->priv = pxa; pxa = sdhci_pltfm_priv(pltfm_host);
pxa->clk_io = devm_clk_get(dev, "io"); pxa->clk_io = devm_clk_get(dev, "io");
if (IS_ERR(pxa->clk_io)) if (IS_ERR(pxa->clk_io))
...@@ -488,7 +484,7 @@ static int sdhci_pxav3_remove(struct platform_device *pdev) ...@@ -488,7 +484,7 @@ static int sdhci_pxav3_remove(struct platform_device *pdev)
{ {
struct sdhci_host *host = platform_get_drvdata(pdev); struct sdhci_host *host = platform_get_drvdata(pdev);
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct sdhci_pxa *pxa = pltfm_host->priv; struct sdhci_pxa *pxa = sdhci_pltfm_priv(pltfm_host);
pm_runtime_get_sync(&pdev->dev); pm_runtime_get_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
...@@ -537,7 +533,7 @@ static int sdhci_pxav3_runtime_suspend(struct device *dev) ...@@ -537,7 +533,7 @@ static int sdhci_pxav3_runtime_suspend(struct device *dev)
{ {
struct sdhci_host *host = dev_get_drvdata(dev); struct sdhci_host *host = dev_get_drvdata(dev);
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct sdhci_pxa *pxa = pltfm_host->priv; struct sdhci_pxa *pxa = sdhci_pltfm_priv(pltfm_host);
int ret; int ret;
ret = sdhci_runtime_suspend_host(host); ret = sdhci_runtime_suspend_host(host);
...@@ -555,7 +551,7 @@ static int sdhci_pxav3_runtime_resume(struct device *dev) ...@@ -555,7 +551,7 @@ static int sdhci_pxav3_runtime_resume(struct device *dev)
{ {
struct sdhci_host *host = dev_get_drvdata(dev); struct sdhci_host *host = dev_get_drvdata(dev);
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct sdhci_pxa *pxa = pltfm_host->priv; struct sdhci_pxa *pxa = sdhci_pltfm_priv(pltfm_host);
clk_prepare_enable(pxa->clk_io); clk_prepare_enable(pxa->clk_io);
if (!IS_ERR(pxa->clk_core)) if (!IS_ERR(pxa->clk_core))
......
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