aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2013-10-17 03:19:46 -0400
committerChris Ball <chris@printf.net>2013-10-21 15:57:51 -0400
commit3770ee8f95a2aa2da66db460a10898e96eee1b13 (patch)
tree994189eaf58c00d0089ef49cd8f16cd256ad6b36
parent9d61c0092ca1abe93853d1b8dfeb5525b6cf3ddc (diff)
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: Shawn Guo <shawn.guo@linaro.org> Acked-by: Dong Aisheng <b29396@freescale.com> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 2421ac7fa6bf..83023fa6fa34 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -134,23 +134,17 @@ static struct platform_device_id imx_esdhc_devtype[] = {
134 .name = "sdhci-esdhc-imx51", 134 .name = "sdhci-esdhc-imx51",
135 .driver_data = IMX51_ESDHC, 135 .driver_data = IMX51_ESDHC,
136 }, { 136 }, {
137 .name = "sdhci-esdhc-imx53",
138 .driver_data = IMX53_ESDHC,
139 }, {
140 .name = "sdhci-usdhc-imx6q",
141 .driver_data = IMX6Q_USDHC,
142 }, {
143 /* sentinel */ 137 /* sentinel */
144 } 138 }
145}; 139};
146MODULE_DEVICE_TABLE(platform, imx_esdhc_devtype); 140MODULE_DEVICE_TABLE(platform, imx_esdhc_devtype);
147 141
148static const struct of_device_id imx_esdhc_dt_ids[] = { 142static const struct of_device_id imx_esdhc_dt_ids[] = {
149 { .compatible = "fsl,imx25-esdhc", .data = &imx_esdhc_devtype[IMX25_ESDHC], }, 143 { .compatible = "fsl,imx25-esdhc", .data = (void *) IMX25_ESDHC, },
150 { .compatible = "fsl,imx35-esdhc", .data = &imx_esdhc_devtype[IMX35_ESDHC], }, 144 { .compatible = "fsl,imx35-esdhc", .data = (void *) IMX35_ESDHC, },
151 { .compatible = "fsl,imx51-esdhc", .data = &imx_esdhc_devtype[IMX51_ESDHC], }, 145 { .compatible = "fsl,imx51-esdhc", .data = (void *) IMX51_ESDHC, },
152 { .compatible = "fsl,imx53-esdhc", .data = &imx_esdhc_devtype[IMX53_ESDHC], }, 146 { .compatible = "fsl,imx53-esdhc", .data = (void *) IMX53_ESDHC, },
153 { .compatible = "fsl,imx6q-usdhc", .data = &imx_esdhc_devtype[IMX6Q_USDHC], }, 147 { .compatible = "fsl,imx6q-usdhc", .data = (void *) IMX6Q_USDHC, },
154 { /* sentinel */ } 148 { /* sentinel */ }
155}; 149};
156MODULE_DEVICE_TABLE(of, imx_esdhc_dt_ids); 150MODULE_DEVICE_TABLE(of, imx_esdhc_dt_ids);
@@ -867,9 +861,8 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
867 goto free_sdhci; 861 goto free_sdhci;
868 } 862 }
869 863
870 if (of_id) 864 imx_data->devtype = of_id ? (enum imx_esdhc_type) of_id->data :
871 pdev->id_entry = of_id->data; 865 pdev->id_entry->driver_data;
872 imx_data->devtype = pdev->id_entry->driver_data;
873 pltfm_host->priv = imx_data; 866 pltfm_host->priv = imx_data;
874 867
875 if (is_imx25_esdhc(imx_data) || is_imx35_esdhc(imx_data)) 868 if (is_imx25_esdhc(imx_data) || is_imx35_esdhc(imx_data))