Commit 3770ee8f authored by Shawn Guo's avatar Shawn Guo Committed by Chris Ball

mmc: sdhci-esdhc-imx: pdev->id_entry should be immutable

As a good practice, device driver should not modify pdev->id_entry but
keep it immutable.  Let's assign of_device_id.data with imx_esdhc_type
constants directly, so that we do not have to manipulate pdev->id_entry
in .probe().

As the result, sdhci-esdhc-imx53 and sdhci-usdhc-imx6q can be removed
from platform_device_id table now, since they will only probe from
device tree.
Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
Acked-by: default avatarDong Aisheng <b29396@freescale.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 9d61c009
...@@ -133,12 +133,6 @@ static struct platform_device_id imx_esdhc_devtype[] = { ...@@ -133,12 +133,6 @@ static struct platform_device_id imx_esdhc_devtype[] = {
}, { }, {
.name = "sdhci-esdhc-imx51", .name = "sdhci-esdhc-imx51",
.driver_data = IMX51_ESDHC, .driver_data = IMX51_ESDHC,
}, {
.name = "sdhci-esdhc-imx53",
.driver_data = IMX53_ESDHC,
}, {
.name = "sdhci-usdhc-imx6q",
.driver_data = IMX6Q_USDHC,
}, { }, {
/* sentinel */ /* sentinel */
} }
...@@ -146,11 +140,11 @@ static struct platform_device_id imx_esdhc_devtype[] = { ...@@ -146,11 +140,11 @@ static struct platform_device_id imx_esdhc_devtype[] = {
MODULE_DEVICE_TABLE(platform, imx_esdhc_devtype); MODULE_DEVICE_TABLE(platform, imx_esdhc_devtype);
static const struct of_device_id imx_esdhc_dt_ids[] = { static const struct of_device_id imx_esdhc_dt_ids[] = {
{ .compatible = "fsl,imx25-esdhc", .data = &imx_esdhc_devtype[IMX25_ESDHC], }, { .compatible = "fsl,imx25-esdhc", .data = (void *) IMX25_ESDHC, },
{ .compatible = "fsl,imx35-esdhc", .data = &imx_esdhc_devtype[IMX35_ESDHC], }, { .compatible = "fsl,imx35-esdhc", .data = (void *) IMX35_ESDHC, },
{ .compatible = "fsl,imx51-esdhc", .data = &imx_esdhc_devtype[IMX51_ESDHC], }, { .compatible = "fsl,imx51-esdhc", .data = (void *) IMX51_ESDHC, },
{ .compatible = "fsl,imx53-esdhc", .data = &imx_esdhc_devtype[IMX53_ESDHC], }, { .compatible = "fsl,imx53-esdhc", .data = (void *) IMX53_ESDHC, },
{ .compatible = "fsl,imx6q-usdhc", .data = &imx_esdhc_devtype[IMX6Q_USDHC], }, { .compatible = "fsl,imx6q-usdhc", .data = (void *) IMX6Q_USDHC, },
{ /* sentinel */ } { /* sentinel */ }
}; };
MODULE_DEVICE_TABLE(of, imx_esdhc_dt_ids); MODULE_DEVICE_TABLE(of, imx_esdhc_dt_ids);
...@@ -867,9 +861,8 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) ...@@ -867,9 +861,8 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
goto free_sdhci; goto free_sdhci;
} }
if (of_id) imx_data->devtype = of_id ? (enum imx_esdhc_type) of_id->data :
pdev->id_entry = of_id->data; pdev->id_entry->driver_data;
imx_data->devtype = pdev->id_entry->driver_data;
pltfm_host->priv = imx_data; pltfm_host->priv = imx_data;
if (is_imx25_esdhc(imx_data) || is_imx35_esdhc(imx_data)) if (is_imx25_esdhc(imx_data) || is_imx35_esdhc(imx_data))
......
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