History

mmc: dw_mmc: constify dw_mci_idmac_ops in exynos back-end

The of_device_id match data is now marked as const and must not be modified. This changes the dw_mmc to mark all pointers passing the dw_mci_drv_data or dw_mci_dma_ops structures as const, and also marks the static definitions as const. drivers/mmc/host/dw_mmc-exynos.c: In function 'dw_mci_exynos_probe': drivers/mmc/host/dw_mmc-exynos.c:234:11: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

Arnd Bergmann committed 14 years ago

Commit 8e2b36e1 parent 517cb9f5 files · +8 −8Browse files

Unified · Split

5 files
  1. drivers/mmc/host/dw_mmc-exynos.c +3 −3
  2. drivers/mmc/host/dw_mmc-pltfm.c +1 −1
  3. drivers/mmc/host/dw_mmc-pltfm.h +1 −1
  4. drivers/mmc/host/dw_mmc.c +1 −1
  5. include/linux/mmc/dw_mmc.h +2 −2
drivers/mmc/host/dw_mmc-exynos.c+3−3
@@ -208,7 +208,7 @@ static unsigned long exynos5250_dwmmc_caps[4] = { · 207 unmodified lines
208208 MMC_CAP_CMD23,
209209 };
210210
211−static struct dw_mci_drv_data exynos5250_drv_data = {
211+static const struct dw_mci_drv_data exynos5250_drv_data = {
212212 .caps = exynos5250_dwmmc_caps,
213213 .init = dw_mci_exynos_priv_init,
214214 .setup_clock = dw_mci_exynos_setup_clock,
@@ -220,14 +220,14 @@ static struct dw_mci_drv_data exynos5250_drv_data = { · 5 unmodified lines
220220
221221 static const struct of_device_id dw_mci_exynos_match[] = {
222222 { .compatible = "samsung,exynos5250-dw-mshc",
223− .data = (void *)&exynos5250_drv_data, },
223+ .data = &exynos5250_drv_data, },
224224 {},
225225 };
226226 MODULE_DEVICE_TABLE(of, dw_mci_exynos_match);
227227
228228 int dw_mci_exynos_probe(struct platform_device *pdev)
229229 {
230− struct dw_mci_drv_data *drv_data;
230+ const struct dw_mci_drv_data *drv_data;
231231 const struct of_device_id *match;
232232
233233 match = of_match_node(dw_mci_exynos_match, pdev->dev.of_node);
drivers/mmc/host/dw_mmc-pltfm.c+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
2424 #include "dw_mmc.h"
2525
2626 int dw_mci_pltfm_register(struct platform_device *pdev,
27− struct dw_mci_drv_data *drv_data)
27+ const struct dw_mci_drv_data *drv_data)
2828 {
2929 struct dw_mci *host;
3030 struct resource *regs;
drivers/mmc/host/dw_mmc-pltfm.h+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 #define _DW_MMC_PLTFM_H_
1414
1515 extern int dw_mci_pltfm_register(struct platform_device *pdev,
16− struct dw_mci_drv_data *drv_data);
16+ const struct dw_mci_drv_data *drv_data);
1717 extern int __devexit dw_mci_pltfm_remove(struct platform_device *pdev);
1818 extern const struct dev_pm_ops dw_mci_pltfm_pmops;
1919
drivers/mmc/host/dw_mmc.c+1−1
@@ -435,7 +435,7 @@ static int dw_mci_idmac_init(struct dw_mci *host) · 434 unmodified lines
435435 return 0;
436436 }
437437
438−static struct dw_mci_dma_ops dw_mci_idmac_ops = {
438+static const struct dw_mci_dma_ops dw_mci_idmac_ops = {
439439 .init = dw_mci_idmac_init,
440440 .start = dw_mci_idmac_start_dma,
441441 .stop = dw_mci_idmac_stop_dma,
include/linux/mmc/dw_mmc.h+2−2
@@ -137,7 +137,7 @@ struct dw_mci { · 136 unmodified lines
137137
138138 dma_addr_t sg_dma;
139139 void *sg_cpu;
140− struct dw_mci_dma_ops *dma_ops;
140+ const struct dw_mci_dma_ops *dma_ops;
141141 #ifdef CONFIG_MMC_DW_IDMAC
142142 unsigned int ring_size;
143143 #else
@@ -162,7 +162,7 @@ struct dw_mci { · 18 unmodified lines
162162 u16 data_offset;
163163 struct device *dev;
164164 struct dw_mci_board *pdata;
165− struct dw_mci_drv_data *drv_data;
165+ const struct dw_mci_drv_data *drv_data;
166166 void *priv;
167167 struct clk *biu_clk;
168168 struct clk *ciu_clk;