linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] mmc: sdhci-pxav3: fix platform_data is not initialized
@ 2015-07-23  9:56 Jingju Hou
  2015-07-23 12:30 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Jingju Hou @ 2015-07-23  9:56 UTC (permalink / raw)
  To: ulf.hansson; +Cc: linux-mmc, Jingju Hou

From: Jingju Hou<houjingj@marvell.com>

pdev->dev.platform_data is not initialized if match is true in function
sdhci_pxav3_probe. Just local variable pdata is assigned the return value
from function pxav3_get_mmc_pdata().

static int sdhci_pxav3_probe(struct platform_device *pdev) {

    struct sdhci_pxa_platdata *pdata = pdev->dev.platform_data;
    ...
    if (match) {
		ret = mmc_of_parse(host->mmc);
		if (ret)
			goto err_of_parse;
		sdhci_get_of_property(pdev);
		pdata = pxav3_get_mmc_pdata(dev);
     }
     ...
}

Signed-off-by: Jingju Hou<houjingj@marvell.com>
Fixes: b650352dd3df("mmc: sdhci-pxa: Add device tree support")
---
 drivers/mmc/host/sdhci-pxav3.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index 9cd5fc6..946d37f 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -411,6 +411,7 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 			goto err_of_parse;
 		sdhci_get_of_property(pdev);
 		pdata = pxav3_get_mmc_pdata(dev);
+		pdev->dev.platform_data = pdata;
 	} else if (pdata) {
 		/* on-chip device */
 		if (pdata->flags & PXA_FLAG_CARD_PERMANENT)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] mmc: sdhci-pxav3: fix platform_data is not initialized
  2015-07-23  9:56 [PATCH v2] mmc: sdhci-pxav3: fix platform_data is not initialized Jingju Hou
@ 2015-07-23 12:30 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2015-07-23 12:30 UTC (permalink / raw)
  To: Jingju Hou; +Cc: linux-mmc

On 23 July 2015 at 11:56, Jingju Hou <houjingj@marvell.com> wrote:
> From: Jingju Hou<houjingj@marvell.com>
>
> pdev->dev.platform_data is not initialized if match is true in function
> sdhci_pxav3_probe. Just local variable pdata is assigned the return value
> from function pxav3_get_mmc_pdata().
>
> static int sdhci_pxav3_probe(struct platform_device *pdev) {
>
>     struct sdhci_pxa_platdata *pdata = pdev->dev.platform_data;
>     ...
>     if (match) {
>                 ret = mmc_of_parse(host->mmc);
>                 if (ret)
>                         goto err_of_parse;
>                 sdhci_get_of_property(pdev);
>                 pdata = pxav3_get_mmc_pdata(dev);
>      }
>      ...
> }
>
> Signed-off-by: Jingju Hou<houjingj@marvell.com>

Added a white-space before the "<".

> Fixes: b650352dd3df("mmc: sdhci-pxa: Add device tree support")

Thanks, applied for fixes!

Kind regards
Uffe

> ---
>  drivers/mmc/host/sdhci-pxav3.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
> index 9cd5fc6..946d37f 100644
> --- a/drivers/mmc/host/sdhci-pxav3.c
> +++ b/drivers/mmc/host/sdhci-pxav3.c
> @@ -411,6 +411,7 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
>                         goto err_of_parse;
>                 sdhci_get_of_property(pdev);
>                 pdata = pxav3_get_mmc_pdata(dev);
> +               pdev->dev.platform_data = pdata;
>         } else if (pdata) {
>                 /* on-chip device */
>                 if (pdata->flags & PXA_FLAG_CARD_PERMANENT)
> --
> 1.7.9.5
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-23 12:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-23  9:56 [PATCH v2] mmc: sdhci-pxav3: fix platform_data is not initialized Jingju Hou
2015-07-23 12:30 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).