aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2013-03-12 04:46:37 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2013-04-05 08:04:20 -0400
commit0984c8910426371205da0b60fc1dae64a996fb64 (patch)
tree7c42eb8e633d1eb7167da0d73b8a1b01226576d1 /drivers
parentcce2a026b5778001002dcab0dadec100d8959846 (diff)
mtd: maps: add const qualifiers
Be a bit stricter and add few more 'const' qualifiers. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/maps/bfin-async-flash.c3
-rw-r--r--drivers/mtd/maps/dc21285.c3
-rw-r--r--drivers/mtd/maps/gpio-addr-flash.c3
-rw-r--r--drivers/mtd/maps/impa7.c7
-rw-r--r--drivers/mtd/maps/intel_vr_nor.c4
-rw-r--r--drivers/mtd/maps/ixp4xx.c2
-rw-r--r--drivers/mtd/maps/lantiq-flash.c3
-rw-r--r--drivers/mtd/maps/pci.c3
-rw-r--r--drivers/mtd/maps/pxa2xx-flash.c4
-rw-r--r--drivers/mtd/maps/rbtx4939-flash.c5
-rw-r--r--drivers/mtd/maps/sa1100-flash.c2
-rw-r--r--drivers/mtd/maps/solutionengine.c2
-rw-r--r--drivers/mtd/maps/tsunami_flash.c5
13 files changed, 21 insertions, 25 deletions
diff --git a/drivers/mtd/maps/bfin-async-flash.c b/drivers/mtd/maps/bfin-async-flash.c
index f833edfaab79..319b04a6c9d1 100644
--- a/drivers/mtd/maps/bfin-async-flash.c
+++ b/drivers/mtd/maps/bfin-async-flash.c
@@ -122,7 +122,8 @@ static void bfin_flash_copy_to(struct map_info *map, unsigned long to, const voi
122 switch_back(state); 122 switch_back(state);
123} 123}
124 124
125static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL }; 125static const char * const part_probe_types[] = {
126 "cmdlinepart", "RedBoot", NULL };
126 127
127static int bfin_flash_probe(struct platform_device *pdev) 128static int bfin_flash_probe(struct platform_device *pdev)
128{ 129{
diff --git a/drivers/mtd/maps/dc21285.c b/drivers/mtd/maps/dc21285.c
index 080f06053bd4..f8a7dd14cee0 100644
--- a/drivers/mtd/maps/dc21285.c
+++ b/drivers/mtd/maps/dc21285.c
@@ -143,9 +143,8 @@ static struct map_info dc21285_map = {
143 .copy_from = dc21285_copy_from, 143 .copy_from = dc21285_copy_from,
144}; 144};
145 145
146
147/* Partition stuff */ 146/* Partition stuff */
148static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; 147static const char * const probes[] = { "RedBoot", "cmdlinepart", NULL };
149 148
150static int __init init_dc21285(void) 149static int __init init_dc21285(void)
151{ 150{
diff --git a/drivers/mtd/maps/gpio-addr-flash.c b/drivers/mtd/maps/gpio-addr-flash.c
index 7b643de2500b..5ede28294f9e 100644
--- a/drivers/mtd/maps/gpio-addr-flash.c
+++ b/drivers/mtd/maps/gpio-addr-flash.c
@@ -157,7 +157,8 @@ static void gf_copy_to(struct map_info *map, unsigned long to,
157 memcpy_toio(map->virt + (to % state->win_size), from, len); 157 memcpy_toio(map->virt + (to % state->win_size), from, len);
158} 158}
159 159
160static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL }; 160static const char * const part_probe_types[] = {
161 "cmdlinepart", "RedBoot", NULL };
161 162
162/** 163/**
163 * gpio_flash_probe() - setup a mapping for a GPIO assisted flash 164 * gpio_flash_probe() - setup a mapping for a GPIO assisted flash
diff --git a/drivers/mtd/maps/impa7.c b/drivers/mtd/maps/impa7.c
index 834a06c56f56..49686744d93c 100644
--- a/drivers/mtd/maps/impa7.c
+++ b/drivers/mtd/maps/impa7.c
@@ -24,14 +24,12 @@
24#define NUM_FLASHBANKS 2 24#define NUM_FLASHBANKS 2
25#define BUSWIDTH 4 25#define BUSWIDTH 4
26 26
27/* can be { "cfi_probe", "jedec_probe", "map_rom", NULL } */
28#define PROBETYPES { "jedec_probe", NULL }
29
30#define MSG_PREFIX "impA7:" /* prefix for our printk()'s */ 27#define MSG_PREFIX "impA7:" /* prefix for our printk()'s */
31#define MTDID "impa7-%d" /* for mtdparts= partitioning */ 28#define MTDID "impa7-%d" /* for mtdparts= partitioning */
32 29
33static struct mtd_info *impa7_mtd[NUM_FLASHBANKS]; 30static struct mtd_info *impa7_mtd[NUM_FLASHBANKS];
34 31
32static const char * const rom_probe_types[] = { "jedec_probe", NULL };
35 33
36static struct map_info impa7_map[NUM_FLASHBANKS] = { 34static struct map_info impa7_map[NUM_FLASHBANKS] = {
37 { 35 {
@@ -60,8 +58,7 @@ static struct mtd_partition partitions[] =
60 58
61static int __init init_impa7(void) 59static int __init init_impa7(void)
62{ 60{
63 static const char *rom_probe_types[] = PROBETYPES; 61 const char * const *type;
64 const char **type;
65 int i; 62 int i;
66 static struct { u_long addr; u_long size; } pt[NUM_FLASHBANKS] = { 63 static struct { u_long addr; u_long size; } pt[NUM_FLASHBANKS] = {
67 { WINDOW_ADDR0, WINDOW_SIZE0 }, 64 { WINDOW_ADDR0, WINDOW_SIZE0 },
diff --git a/drivers/mtd/maps/intel_vr_nor.c b/drivers/mtd/maps/intel_vr_nor.c
index b14053b25026..f581ac1cf022 100644
--- a/drivers/mtd/maps/intel_vr_nor.c
+++ b/drivers/mtd/maps/intel_vr_nor.c
@@ -82,9 +82,9 @@ static void vr_nor_destroy_mtd_setup(struct vr_nor_mtd *p)
82 82
83static int vr_nor_mtd_setup(struct vr_nor_mtd *p) 83static int vr_nor_mtd_setup(struct vr_nor_mtd *p)
84{ 84{
85 static const char *probe_types[] = 85 static const char * const probe_types[] =
86 { "cfi_probe", "jedec_probe", NULL }; 86 { "cfi_probe", "jedec_probe", NULL };
87 const char **type; 87 const char * const *type;
88 88
89 for (type = probe_types; !p->info && *type; type++) 89 for (type = probe_types; !p->info && *type; type++)
90 p->info = do_map_probe(*type, &p->map); 90 p->info = do_map_probe(*type, &p->map);
diff --git a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c
index e864fc6c58f9..52b3410a105c 100644
--- a/drivers/mtd/maps/ixp4xx.c
+++ b/drivers/mtd/maps/ixp4xx.c
@@ -148,7 +148,7 @@ struct ixp4xx_flash_info {
148 struct resource *res; 148 struct resource *res;
149}; 149};
150 150
151static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; 151static const char * const probes[] = { "RedBoot", "cmdlinepart", NULL };
152 152
153static int ixp4xx_flash_remove(struct platform_device *dev) 153static int ixp4xx_flash_remove(struct platform_device *dev)
154{ 154{
diff --git a/drivers/mtd/maps/lantiq-flash.c b/drivers/mtd/maps/lantiq-flash.c
index d1da6ede3845..d7ac65d1d569 100644
--- a/drivers/mtd/maps/lantiq-flash.c
+++ b/drivers/mtd/maps/lantiq-flash.c
@@ -46,8 +46,7 @@ struct ltq_mtd {
46}; 46};
47 47
48static const char ltq_map_name[] = "ltq_nor"; 48static const char ltq_map_name[] = "ltq_nor";
49static const char *ltq_probe_types[] = { 49static const char * const ltq_probe_types[] = { "cmdlinepart", "ofpart", NULL };
50 "cmdlinepart", "ofpart", NULL };
51 50
52static map_word 51static map_word
53ltq_read16(struct map_info *map, unsigned long adr) 52ltq_read16(struct map_info *map, unsigned long adr)
diff --git a/drivers/mtd/maps/pci.c b/drivers/mtd/maps/pci.c
index c3aebd5da5d6..c2604f8b2a5e 100644
--- a/drivers/mtd/maps/pci.c
+++ b/drivers/mtd/maps/pci.c
@@ -283,8 +283,7 @@ static int mtd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
283 if (err) 283 if (err)
284 goto release; 284 goto release;
285 285
286 /* tsk - do_map_probe should take const char * */ 286 mtd = do_map_probe(info->map_name, &map->map);
287 mtd = do_map_probe((char *)info->map_name, &map->map);
288 err = -ENODEV; 287 err = -ENODEV;
289 if (!mtd) 288 if (!mtd)
290 goto release; 289 goto release;
diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c
index 43e3dbb976d9..acb1dbcf7ce5 100644
--- a/drivers/mtd/maps/pxa2xx-flash.c
+++ b/drivers/mtd/maps/pxa2xx-flash.c
@@ -45,9 +45,7 @@ struct pxa2xx_flash_info {
45 struct map_info map; 45 struct map_info map;
46}; 46};
47 47
48 48static const char * const probes[] = { "RedBoot", "cmdlinepart", NULL };
49static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
50
51 49
52static int pxa2xx_flash_probe(struct platform_device *pdev) 50static int pxa2xx_flash_probe(struct platform_device *pdev)
53{ 51{
diff --git a/drivers/mtd/maps/rbtx4939-flash.c b/drivers/mtd/maps/rbtx4939-flash.c
index 49c3fe715eee..ac02fbffd6df 100644
--- a/drivers/mtd/maps/rbtx4939-flash.c
+++ b/drivers/mtd/maps/rbtx4939-flash.c
@@ -45,14 +45,15 @@ static int rbtx4939_flash_remove(struct platform_device *dev)
45 return 0; 45 return 0;
46} 46}
47 47
48static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL }; 48static const char * const rom_probe_types[] = {
49 "cfi_probe", "jedec_probe", NULL };
49 50
50static int rbtx4939_flash_probe(struct platform_device *dev) 51static int rbtx4939_flash_probe(struct platform_device *dev)
51{ 52{
52 struct rbtx4939_flash_data *pdata; 53 struct rbtx4939_flash_data *pdata;
53 struct rbtx4939_flash_info *info; 54 struct rbtx4939_flash_info *info;
54 struct resource *res; 55 struct resource *res;
55 const char **probe_type; 56 const char * const *probe_type;
56 int err = 0; 57 int err = 0;
57 unsigned long size; 58 unsigned long size;
58 59
diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c
index f694417cf7e6..29e3dcaa1d90 100644
--- a/drivers/mtd/maps/sa1100-flash.c
+++ b/drivers/mtd/maps/sa1100-flash.c
@@ -244,7 +244,7 @@ static struct sa_info *sa1100_setup_mtd(struct platform_device *pdev,
244 return ERR_PTR(ret); 244 return ERR_PTR(ret);
245} 245}
246 246
247static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL }; 247static const char * const part_probes[] = { "cmdlinepart", "RedBoot", NULL };
248 248
249static int sa1100_mtd_probe(struct platform_device *pdev) 249static int sa1100_mtd_probe(struct platform_device *pdev)
250{ 250{
diff --git a/drivers/mtd/maps/solutionengine.c b/drivers/mtd/maps/solutionengine.c
index 9d900ada6708..83a7a7091562 100644
--- a/drivers/mtd/maps/solutionengine.c
+++ b/drivers/mtd/maps/solutionengine.c
@@ -31,7 +31,7 @@ struct map_info soleng_flash_map = {
31 .bankwidth = 4, 31 .bankwidth = 4,
32}; 32};
33 33
34static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; 34static const char * const probes[] = { "RedBoot", "cmdlinepart", NULL };
35 35
36#ifdef CONFIG_MTD_SUPERH_RESERVE 36#ifdef CONFIG_MTD_SUPERH_RESERVE
37static struct mtd_partition superh_se_partitions[] = { 37static struct mtd_partition superh_se_partitions[] = {
diff --git a/drivers/mtd/maps/tsunami_flash.c b/drivers/mtd/maps/tsunami_flash.c
index 1de390e1c2fb..da2cdb5fd6db 100644
--- a/drivers/mtd/maps/tsunami_flash.c
+++ b/drivers/mtd/maps/tsunami_flash.c
@@ -82,11 +82,12 @@ static void __exit cleanup_tsunami_flash(void)
82 tsunami_flash_mtd = 0; 82 tsunami_flash_mtd = 0;
83} 83}
84 84
85static const char * const rom_probe_types[] = {
86 "cfi_probe", "jedec_probe", "map_rom", NULL };
85 87
86static int __init init_tsunami_flash(void) 88static int __init init_tsunami_flash(void)
87{ 89{
88 static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", NULL }; 90 const char * const *type;
89 char **type;
90 91
91 tsunami_tig_writeb(FLASH_ENABLE_BYTE, FLASH_ENABLE_PORT); 92 tsunami_tig_writeb(FLASH_ENABLE_BYTE, FLASH_ENABLE_PORT);
92 93