aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-03-13 14:26:03 -0400
committerChris Ball <cjb@laptop.org>2013-03-22 13:00:06 -0400
commit1db5eebf22f86a87c3fcbbb085a4abbcfd09ee7d (patch)
tree90eac2d5bfaa90c8065bbf42ffb6bf6ff55f1fd1
parent91cf54feecf815bec0b6a8d6d9dbd0e219f2f2cc (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.c2
-rw-r--r--drivers/mmc/host/sdhci-cns3xxx.c2
-rw-r--r--drivers/mmc/host/sdhci-dove.c2
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c2
-rw-r--r--drivers/mmc/host/sdhci-of-esdhc.c2
-rw-r--r--drivers/mmc/host/sdhci-of-hlwd.c2
-rw-r--r--drivers/mmc/host/sdhci-pltfm.c4
-rw-r--r--drivers/mmc/host/sdhci-pltfm.h4
-rw-r--r--drivers/mmc/host/sdhci-tegra.c8
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
138static struct sdhci_pltfm_data bcm2835_sdhci_pdata = { 138static 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
88static struct sdhci_pltfm_data sdhci_cns3xxx_pdata = { 88static 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
91static struct sdhci_pltfm_data sdhci_dove_pdata = { 91static 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
415static struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = { 415static 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
252static struct sdhci_pltfm_data sdhci_esdhc_pdata = { 252static 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
63static struct sdhci_pltfm_data sdhci_hlwd_pdata = { 63static 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) {}
115EXPORT_SYMBOL_GPL(sdhci_get_of_property); 115EXPORT_SYMBOL_GPL(sdhci_get_of_property);
116 116
117struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, 117struct 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)
202EXPORT_SYMBOL_GPL(sdhci_pltfm_free); 202EXPORT_SYMBOL_GPL(sdhci_pltfm_free);
203 203
204int sdhci_pltfm_register(struct platform_device *pdev, 204int 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)
91extern void sdhci_get_of_property(struct platform_device *pdev); 91extern void sdhci_get_of_property(struct platform_device *pdev);
92 92
93extern struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, 93extern struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
94 struct sdhci_pltfm_data *pdata); 94 const struct sdhci_pltfm_data *pdata);
95extern void sdhci_pltfm_free(struct platform_device *pdev); 95extern void sdhci_pltfm_free(struct platform_device *pdev);
96 96
97extern int sdhci_pltfm_register(struct platform_device *pdev, 97extern int sdhci_pltfm_register(struct platform_device *pdev,
98 struct sdhci_pltfm_data *pdata); 98 const struct sdhci_pltfm_data *pdata);
99extern int sdhci_pltfm_unregister(struct platform_device *pdev); 99extern int sdhci_pltfm_unregister(struct platform_device *pdev);
100 100
101extern unsigned int sdhci_pltfm_clk_get_max_clock(struct sdhci_host *host); 101extern 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
41struct sdhci_tegra_soc_data { 41struct 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
159static struct sdhci_pltfm_data sdhci_tegra20_pdata = { 159static 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
173static struct sdhci_pltfm_data sdhci_tegra30_pdata = { 173static 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
187static struct sdhci_pltfm_data sdhci_tegra114_pdata = { 187static 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 |