Commit 9cd76049 authored by Jingju Hou's avatar Jingju Hou Committed by Ulf Hansson

mmc: sdhci-pxav3: fix platform_data is not initialized

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: default avatarJingju Hou <houjingj@marvell.com>
Fixes: b650352d("mmc: sdhci-pxa: Add device tree support")
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent cae13e79
...@@ -411,6 +411,7 @@ static int sdhci_pxav3_probe(struct platform_device *pdev) ...@@ -411,6 +411,7 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
goto err_of_parse; goto err_of_parse;
sdhci_get_of_property(pdev); sdhci_get_of_property(pdev);
pdata = pxav3_get_mmc_pdata(dev); pdata = pxav3_get_mmc_pdata(dev);
pdev->dev.platform_data = pdata;
} else if (pdata) { } else if (pdata) {
/* on-chip device */ /* on-chip device */
if (pdata->flags & PXA_FLAG_CARD_PERMANENT) if (pdata->flags & PXA_FLAG_CARD_PERMANENT)
......
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