diff mbox

[v3] mmc: sdhci-pxav3: fix platform_data is not initialized

Message ID 1437700545-14660-1-git-send-email-houjingj@marvell.com (mailing list archive)
State New, archived
Headers show

Commit Message

houjingj July 24, 2015, 1:15 a.m. UTC
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(+)

Comments

Ulf Hansson July 24, 2015, 7:40 a.m. UTC | #1
On 24 July 2015 at 03:15, Jingju Hou <houjingj@marvell.com> wrote:
> 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")

You didn't need to send a v3, I have already queued the v2. I assume
this one only change in v3 is the small white space change, right?

BTW, until next time you send a patch, it helps if you add version
history such one can follow what changed.

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
>
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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)