Commit cce2a026b5778001002dcab0dadec100d8959846
Committed by
David Woodhouse
1 parent
255e9fd4b1
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
mtd: physmap_of: 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>
Showing 1 changed file with 9 additions and 7 deletions Side-by-side Diff
drivers/mtd/maps/physmap_of.c
... | ... | @@ -71,6 +71,9 @@ |
71 | 71 | return 0; |
72 | 72 | } |
73 | 73 | |
74 | +static const char * const rom_probe_types[] = { | |
75 | + "cfi_probe", "jedec_probe", "map_rom" }; | |
76 | + | |
74 | 77 | /* Helper function to handle probing of the obsolete "direct-mapped" |
75 | 78 | * compatible binding, which has an extra "probe-type" property |
76 | 79 | * describing the type of flash probe necessary. */ |
... | ... | @@ -80,8 +83,6 @@ |
80 | 83 | struct device_node *dp = dev->dev.of_node; |
81 | 84 | const char *of_probe; |
82 | 85 | struct mtd_info *mtd; |
83 | - static const char *rom_probe_types[] | |
84 | - = { "cfi_probe", "jedec_probe", "map_rom"}; | |
85 | 86 | int i; |
86 | 87 | |
87 | 88 | dev_warn(&dev->dev, "Device tree uses obsolete \"direct-mapped\" " |
... | ... | @@ -111,9 +112,10 @@ |
111 | 112 | specifies the list of partition probers to use. If none is given then the |
112 | 113 | default is use. These take precedence over other device tree |
113 | 114 | information. */ |
114 | -static const char *part_probe_types_def[] = { "cmdlinepart", "RedBoot", | |
115 | - "ofpart", "ofoldpart", NULL }; | |
116 | -static const char **of_get_probes(struct device_node *dp) | |
115 | +static const char * const part_probe_types_def[] = { | |
116 | + "cmdlinepart", "RedBoot", "ofpart", "ofoldpart", NULL }; | |
117 | + | |
118 | +static const char * const *of_get_probes(struct device_node *dp) | |
117 | 119 | { |
118 | 120 | const char *cp; |
119 | 121 | int cplen; |
... | ... | @@ -142,7 +144,7 @@ |
142 | 144 | return res; |
143 | 145 | } |
144 | 146 | |
145 | -static void of_free_probes(const char **probes) | |
147 | +static void of_free_probes(const char * const *probes) | |
146 | 148 | { |
147 | 149 | if (probes != part_probe_types_def) |
148 | 150 | kfree(probes); |
... | ... | @@ -151,7 +153,7 @@ |
151 | 153 | static struct of_device_id of_flash_match[]; |
152 | 154 | static int of_flash_probe(struct platform_device *dev) |
153 | 155 | { |
154 | - const char **part_probe_types; | |
156 | + const char * const *part_probe_types; | |
155 | 157 | const struct of_device_id *match; |
156 | 158 | struct device_node *dp = dev->dev.of_node; |
157 | 159 | struct resource res; |