diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-03-13 14:26:03 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-03-22 13:00:06 -0400 |
commit | 1db5eebf22f86a87c3fcbbb085a4abbcfd09ee7d (patch) | |
tree | 90eac2d5bfaa90c8065bbf42ffb6bf6ff55f1fd1 | |
parent | 91cf54feecf815bec0b6a8d6d9dbd0e219f2f2cc (diff) |
mmc: sdhci_pltfm: Constify sdhci_pltfm_data
The sdhci_pltfm_data struct is never modified within the sdhci_pltfm
module. So make the pdata parameter to sdhci_pltfm_init and
sdhci_pltfm_register const. This allows drivers to declare their
sdhci_pltfm_data struct as const.
This patch also makes the sdhci_pltfm_data declarations const where
possible.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r-- | drivers/mmc/host/sdhci-bcm2835.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-cns3xxx.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-dove.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-esdhc-imx.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-of-esdhc.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-of-hlwd.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-pltfm.c | 4 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-pltfm.h | 4 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-tegra.c | 8 |
9 files changed, 14 insertions, 14 deletions
diff --git a/drivers/mmc/host/sdhci-bcm2835.c b/drivers/mmc/host/sdhci-bcm2835.c index 8ffea05152c6..29e9e4008885 100644 --- a/drivers/mmc/host/sdhci-bcm2835.c +++ b/drivers/mmc/host/sdhci-bcm2835.c | |||
@@ -135,7 +135,7 @@ static struct sdhci_ops bcm2835_sdhci_ops = { | |||
135 | .get_min_clock = bcm2835_sdhci_get_min_clock, | 135 | .get_min_clock = bcm2835_sdhci_get_min_clock, |
136 | }; | 136 | }; |
137 | 137 | ||
138 | static struct sdhci_pltfm_data bcm2835_sdhci_pdata = { | 138 | static const struct sdhci_pltfm_data bcm2835_sdhci_pdata = { |
139 | .quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION | | 139 | .quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION | |
140 | SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK, | 140 | SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK, |
141 | .ops = &bcm2835_sdhci_ops, | 141 | .ops = &bcm2835_sdhci_ops, |
diff --git a/drivers/mmc/host/sdhci-cns3xxx.c b/drivers/mmc/host/sdhci-cns3xxx.c index 30bfdc4ae52a..15a936ae08b8 100644 --- a/drivers/mmc/host/sdhci-cns3xxx.c +++ b/drivers/mmc/host/sdhci-cns3xxx.c | |||
@@ -85,7 +85,7 @@ static struct sdhci_ops sdhci_cns3xxx_ops = { | |||
85 | .set_clock = sdhci_cns3xxx_set_clock, | 85 | .set_clock = sdhci_cns3xxx_set_clock, |
86 | }; | 86 | }; |
87 | 87 | ||
88 | static struct sdhci_pltfm_data sdhci_cns3xxx_pdata = { | 88 | static const struct sdhci_pltfm_data sdhci_cns3xxx_pdata = { |
89 | .ops = &sdhci_cns3xxx_ops, | 89 | .ops = &sdhci_cns3xxx_ops, |
90 | .quirks = SDHCI_QUIRK_BROKEN_DMA | | 90 | .quirks = SDHCI_QUIRK_BROKEN_DMA | |
91 | SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | | 91 | SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | |
diff --git a/drivers/mmc/host/sdhci-dove.c b/drivers/mmc/host/sdhci-dove.c index 169fab91778e..b514f68d6f1b 100644 --- a/drivers/mmc/host/sdhci-dove.c +++ b/drivers/mmc/host/sdhci-dove.c | |||
@@ -88,7 +88,7 @@ static struct sdhci_ops sdhci_dove_ops = { | |||
88 | .read_l = sdhci_dove_readl, | 88 | .read_l = sdhci_dove_readl, |
89 | }; | 89 | }; |
90 | 90 | ||
91 | static struct sdhci_pltfm_data sdhci_dove_pdata = { | 91 | static const struct sdhci_pltfm_data sdhci_dove_pdata = { |
92 | .ops = &sdhci_dove_ops, | 92 | .ops = &sdhci_dove_ops, |
93 | .quirks = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER | | 93 | .quirks = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER | |
94 | SDHCI_QUIRK_NO_BUSY_IRQ | | 94 | SDHCI_QUIRK_NO_BUSY_IRQ | |
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 78ac00227c1a..68c301d12db4 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c | |||
@@ -412,7 +412,7 @@ static struct sdhci_ops sdhci_esdhc_ops = { | |||
412 | .platform_bus_width = esdhc_pltfm_bus_width, | 412 | .platform_bus_width = esdhc_pltfm_bus_width, |
413 | }; | 413 | }; |
414 | 414 | ||
415 | static struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = { | 415 | static const struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = { |
416 | .quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_NO_HISPD_BIT | 416 | .quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_NO_HISPD_BIT |
417 | | SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC | 417 | | SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC |
418 | | SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC | 418 | | SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c index f32526d2d966..b98b91969d8b 100644 --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c | |||
@@ -249,7 +249,7 @@ static struct sdhci_ops sdhci_esdhc_ops = { | |||
249 | .adma_workaround = esdhci_of_adma_workaround, | 249 | .adma_workaround = esdhci_of_adma_workaround, |
250 | }; | 250 | }; |
251 | 251 | ||
252 | static struct sdhci_pltfm_data sdhci_esdhc_pdata = { | 252 | static const struct sdhci_pltfm_data sdhci_esdhc_pdata = { |
253 | /* | 253 | /* |
254 | * card detection could be handled via GPIO | 254 | * card detection could be handled via GPIO |
255 | * eSDHC cannot support End Attribute in NOP ADMA descriptor | 255 | * eSDHC cannot support End Attribute in NOP ADMA descriptor |
diff --git a/drivers/mmc/host/sdhci-of-hlwd.c b/drivers/mmc/host/sdhci-of-hlwd.c index c3d3715ec3d7..7ea5c02268df 100644 --- a/drivers/mmc/host/sdhci-of-hlwd.c +++ b/drivers/mmc/host/sdhci-of-hlwd.c | |||
@@ -60,7 +60,7 @@ static struct sdhci_ops sdhci_hlwd_ops = { | |||
60 | .write_b = sdhci_hlwd_writeb, | 60 | .write_b = sdhci_hlwd_writeb, |
61 | }; | 61 | }; |
62 | 62 | ||
63 | static struct sdhci_pltfm_data sdhci_hlwd_pdata = { | 63 | static const struct sdhci_pltfm_data sdhci_hlwd_pdata = { |
64 | .quirks = SDHCI_QUIRK_32BIT_DMA_ADDR | | 64 | .quirks = SDHCI_QUIRK_32BIT_DMA_ADDR | |
65 | SDHCI_QUIRK_32BIT_DMA_SIZE, | 65 | SDHCI_QUIRK_32BIT_DMA_SIZE, |
66 | .ops = &sdhci_hlwd_ops, | 66 | .ops = &sdhci_hlwd_ops, |
diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index 9db7b12d2084..3893fd6ae56e 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c | |||
@@ -115,7 +115,7 @@ void sdhci_get_of_property(struct platform_device *pdev) {} | |||
115 | EXPORT_SYMBOL_GPL(sdhci_get_of_property); | 115 | EXPORT_SYMBOL_GPL(sdhci_get_of_property); |
116 | 116 | ||
117 | struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, | 117 | struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, |
118 | struct sdhci_pltfm_data *pdata) | 118 | const struct sdhci_pltfm_data *pdata) |
119 | { | 119 | { |
120 | struct sdhci_host *host; | 120 | struct sdhci_host *host; |
121 | struct sdhci_pltfm_host *pltfm_host; | 121 | struct sdhci_pltfm_host *pltfm_host; |
@@ -202,7 +202,7 @@ void sdhci_pltfm_free(struct platform_device *pdev) | |||
202 | EXPORT_SYMBOL_GPL(sdhci_pltfm_free); | 202 | EXPORT_SYMBOL_GPL(sdhci_pltfm_free); |
203 | 203 | ||
204 | int sdhci_pltfm_register(struct platform_device *pdev, | 204 | int sdhci_pltfm_register(struct platform_device *pdev, |
205 | struct sdhci_pltfm_data *pdata) | 205 | const struct sdhci_pltfm_data *pdata) |
206 | { | 206 | { |
207 | struct sdhci_host *host; | 207 | struct sdhci_host *host; |
208 | int ret = 0; | 208 | int ret = 0; |
diff --git a/drivers/mmc/host/sdhci-pltfm.h b/drivers/mmc/host/sdhci-pltfm.h index 153b6c509ebe..a3bfc1e11539 100644 --- a/drivers/mmc/host/sdhci-pltfm.h +++ b/drivers/mmc/host/sdhci-pltfm.h | |||
@@ -91,11 +91,11 @@ static inline void sdhci_be32bs_writeb(struct sdhci_host *host, u8 val, int reg) | |||
91 | extern void sdhci_get_of_property(struct platform_device *pdev); | 91 | extern void sdhci_get_of_property(struct platform_device *pdev); |
92 | 92 | ||
93 | extern struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, | 93 | extern struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, |
94 | struct sdhci_pltfm_data *pdata); | 94 | const struct sdhci_pltfm_data *pdata); |
95 | extern void sdhci_pltfm_free(struct platform_device *pdev); | 95 | extern void sdhci_pltfm_free(struct platform_device *pdev); |
96 | 96 | ||
97 | extern int sdhci_pltfm_register(struct platform_device *pdev, | 97 | extern int sdhci_pltfm_register(struct platform_device *pdev, |
98 | struct sdhci_pltfm_data *pdata); | 98 | const struct sdhci_pltfm_data *pdata); |
99 | extern int sdhci_pltfm_unregister(struct platform_device *pdev); | 99 | extern int sdhci_pltfm_unregister(struct platform_device *pdev); |
100 | 100 | ||
101 | extern unsigned int sdhci_pltfm_clk_get_max_clock(struct sdhci_host *host); | 101 | extern unsigned int sdhci_pltfm_clk_get_max_clock(struct sdhci_host *host); |
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c index c665d1d26320..f8ac50c2883e 100644 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #define NVQUIRK_ENABLE_SDHCI_SPEC_300 BIT(2) | 39 | #define NVQUIRK_ENABLE_SDHCI_SPEC_300 BIT(2) |
40 | 40 | ||
41 | struct sdhci_tegra_soc_data { | 41 | struct sdhci_tegra_soc_data { |
42 | struct sdhci_pltfm_data *pdata; | 42 | const struct sdhci_pltfm_data *pdata; |
43 | u32 nvquirks; | 43 | u32 nvquirks; |
44 | }; | 44 | }; |
45 | 45 | ||
@@ -156,7 +156,7 @@ static struct sdhci_ops tegra_sdhci_ops = { | |||
156 | .platform_reset_exit = tegra_sdhci_reset_exit, | 156 | .platform_reset_exit = tegra_sdhci_reset_exit, |
157 | }; | 157 | }; |
158 | 158 | ||
159 | static struct sdhci_pltfm_data sdhci_tegra20_pdata = { | 159 | static const struct sdhci_pltfm_data sdhci_tegra20_pdata = { |
160 | .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | | 160 | .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | |
161 | SDHCI_QUIRK_SINGLE_POWER_WRITE | | 161 | SDHCI_QUIRK_SINGLE_POWER_WRITE | |
162 | SDHCI_QUIRK_NO_HISPD_BIT | | 162 | SDHCI_QUIRK_NO_HISPD_BIT | |
@@ -170,7 +170,7 @@ static struct sdhci_tegra_soc_data soc_data_tegra20 = { | |||
170 | NVQUIRK_ENABLE_BLOCK_GAP_DET, | 170 | NVQUIRK_ENABLE_BLOCK_GAP_DET, |
171 | }; | 171 | }; |
172 | 172 | ||
173 | static struct sdhci_pltfm_data sdhci_tegra30_pdata = { | 173 | static const struct sdhci_pltfm_data sdhci_tegra30_pdata = { |
174 | .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | | 174 | .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | |
175 | SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | | 175 | SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | |
176 | SDHCI_QUIRK_SINGLE_POWER_WRITE | | 176 | SDHCI_QUIRK_SINGLE_POWER_WRITE | |
@@ -184,7 +184,7 @@ static struct sdhci_tegra_soc_data soc_data_tegra30 = { | |||
184 | .nvquirks = NVQUIRK_ENABLE_SDHCI_SPEC_300, | 184 | .nvquirks = NVQUIRK_ENABLE_SDHCI_SPEC_300, |
185 | }; | 185 | }; |
186 | 186 | ||
187 | static struct sdhci_pltfm_data sdhci_tegra114_pdata = { | 187 | static const struct sdhci_pltfm_data sdhci_tegra114_pdata = { |
188 | .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | | 188 | .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | |
189 | SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | | 189 | SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | |
190 | SDHCI_QUIRK_SINGLE_POWER_WRITE | | 190 | SDHCI_QUIRK_SINGLE_POWER_WRITE | |