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>
of_device_get_match_data(&pdev->dev);
if (!host->data) {
ret = -EINVAL;
+ pr_info("host->data null\n");
goto probe_free_host;
}
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,
},
{},
};
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,
},
{},
};
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;