emmc: refixed how to get host->data variable in M8bab

PD#154260: emmc: refixed how to get host->data variable for M8b

    1. refixed how to get host->data variable

    2. Compatible m8b and 905

Change-Id: I647fb191f71a3a4b6b63eee29be1a91e6581af12
Signed-off-by: Long Yu <long.yu@amlogic.com>
This commit is contained in:
Long Yu
2017-12-25 16:56:21 +08:00
parent d7e777497e
commit 94e0d11b88
3 changed files with 14 additions and 1 deletions

View File

@@ -2253,6 +2253,7 @@ static int aml_sdhc_probe(struct platform_device *pdev)
of_device_get_match_data(&pdev->dev);
if (!host->data) {
ret = -EINVAL;
pr_info("host->data null\n");
goto probe_free_host;
}
@@ -2420,9 +2421,14 @@ int aml_sdhc_remove(struct platform_device *pdev)
return 0;
}
static struct meson_mmc_data mmc_data_m8b = {
.chip_type = MMC_CHIP_M8B,
};
static const struct of_device_id aml_sdhc_dt_match[] = {
{
.compatible = "amlogic, aml_sdhc",
.data = &mmc_data_m8b,
},
{},
};

View File

@@ -1335,9 +1335,14 @@ fail_init_host:
return 0;
}
static struct meson_mmc_data mmc_data_m8b = {
.chip_type = MMC_CHIP_M8B,
};
static const struct of_device_id aml_sdio_dt_match[] = {
{
.compatible = "amlogic, aml_sdio",
.data = &mmc_data_m8b,
},
{},
};

View File

@@ -126,14 +126,16 @@ int amlsd_get_platform_data(struct platform_device *pdev,
struct device_node *child;
u32 i, prop;
const char *str = "none";
struct amlsd_host *host = mmc_priv(mmc);
struct amlsd_host *host = NULL;
#ifdef CONFIG_AMLOGIC_M8B_MMC
of_node = pdev->dev.of_node;
host = platform_get_drvdata(pdev);
#else
if (!mmc->parent)
return 0;
of_node = mmc->parent->of_node;
host = mmc_priv(mmc);
#endif
if (of_node) {
child = of_node->child;