diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2006-07-12 01:39:43 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-07-31 01:55:04 -0400 |
commit | 954a46e2d5aec6f59976ddeb1d232b486e59b54a (patch) | |
tree | 4e34abf431de3d6a31036c1fdf33fa4dadeb2951 /drivers | |
parent | a7f67bdf2c9f24509b8e81e0f35573b611987c80 (diff) |
[POWERPC] pseries: Constify & voidify get_property()
Now that get_property() returns a void *, there's no need to cast its
return value. Also, treat the return value as const, so we can
constify get_property later.
pseries platform changes.
Built for pseries_defconfig
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/hvc_vio.c | 4 | ||||
-rw-r--r-- | drivers/char/hvsi.c | 7 | ||||
-rw-r--r-- | drivers/pci/hotplug/rpaphp_core.c | 32 |
3 files changed, 21 insertions, 22 deletions
diff --git a/drivers/char/hvc_vio.c b/drivers/char/hvc_vio.c index 651e5d25f58b..cc95941148fb 100644 --- a/drivers/char/hvc_vio.c +++ b/drivers/char/hvc_vio.c | |||
@@ -141,7 +141,7 @@ static int hvc_find_vtys(void) | |||
141 | 141 | ||
142 | for (vty = of_find_node_by_name(NULL, "vty"); vty != NULL; | 142 | for (vty = of_find_node_by_name(NULL, "vty"); vty != NULL; |
143 | vty = of_find_node_by_name(vty, "vty")) { | 143 | vty = of_find_node_by_name(vty, "vty")) { |
144 | uint32_t *vtermno; | 144 | const uint32_t *vtermno; |
145 | 145 | ||
146 | /* We have statically defined space for only a certain number | 146 | /* We have statically defined space for only a certain number |
147 | * of console adapters. | 147 | * of console adapters. |
@@ -149,7 +149,7 @@ static int hvc_find_vtys(void) | |||
149 | if (num_found >= MAX_NR_HVC_CONSOLES) | 149 | if (num_found >= MAX_NR_HVC_CONSOLES) |
150 | break; | 150 | break; |
151 | 151 | ||
152 | vtermno = (uint32_t *)get_property(vty, "reg", NULL); | 152 | vtermno = get_property(vty, "reg", NULL); |
153 | if (!vtermno) | 153 | if (!vtermno) |
154 | continue; | 154 | continue; |
155 | 155 | ||
diff --git a/drivers/char/hvsi.c b/drivers/char/hvsi.c index 56612a2dca6b..542de0e51f35 100644 --- a/drivers/char/hvsi.c +++ b/drivers/char/hvsi.c | |||
@@ -1276,11 +1276,10 @@ static int __init hvsi_console_init(void) | |||
1276 | vty != NULL; | 1276 | vty != NULL; |
1277 | vty = of_find_compatible_node(vty, "serial", "hvterm-protocol")) { | 1277 | vty = of_find_compatible_node(vty, "serial", "hvterm-protocol")) { |
1278 | struct hvsi_struct *hp; | 1278 | struct hvsi_struct *hp; |
1279 | uint32_t *vtermno; | 1279 | const uint32_t *vtermno, *irq; |
1280 | uint32_t *irq; | ||
1281 | 1280 | ||
1282 | vtermno = (uint32_t *)get_property(vty, "reg", NULL); | 1281 | vtermno = get_property(vty, "reg", NULL); |
1283 | irq = (uint32_t *)get_property(vty, "interrupts", NULL); | 1282 | irq = get_property(vty, "interrupts", NULL); |
1284 | if (!vtermno || !irq) | 1283 | if (!vtermno || !irq) |
1285 | continue; | 1284 | continue; |
1286 | 1285 | ||
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c index 076bd6dcafae..7288a3eccfb3 100644 --- a/drivers/pci/hotplug/rpaphp_core.c +++ b/drivers/pci/hotplug/rpaphp_core.c | |||
@@ -176,16 +176,16 @@ static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_spe | |||
176 | return 0; | 176 | return 0; |
177 | } | 177 | } |
178 | 178 | ||
179 | static int get_children_props(struct device_node *dn, int **drc_indexes, | 179 | static int get_children_props(struct device_node *dn, const int **drc_indexes, |
180 | int **drc_names, int **drc_types, int **drc_power_domains) | 180 | const int **drc_names, const int **drc_types, |
181 | const int **drc_power_domains) | ||
181 | { | 182 | { |
182 | int *indexes, *names; | 183 | const int *indexes, *names, *types, *domains; |
183 | int *types, *domains; | ||
184 | 184 | ||
185 | indexes = (int *) get_property(dn, "ibm,drc-indexes", NULL); | 185 | indexes = get_property(dn, "ibm,drc-indexes", NULL); |
186 | names = (int *) get_property(dn, "ibm,drc-names", NULL); | 186 | names = get_property(dn, "ibm,drc-names", NULL); |
187 | types = (int *) get_property(dn, "ibm,drc-types", NULL); | 187 | types = get_property(dn, "ibm,drc-types", NULL); |
188 | domains = (int *) get_property(dn, "ibm,drc-power-domains", NULL); | 188 | domains = get_property(dn, "ibm,drc-power-domains", NULL); |
189 | 189 | ||
190 | if (!indexes || !names || !types || !domains) { | 190 | if (!indexes || !names || !types || !domains) { |
191 | /* Slot does not have dynamically-removable children */ | 191 | /* Slot does not have dynamically-removable children */ |
@@ -212,13 +212,13 @@ static int get_children_props(struct device_node *dn, int **drc_indexes, | |||
212 | int rpaphp_get_drc_props(struct device_node *dn, int *drc_index, | 212 | int rpaphp_get_drc_props(struct device_node *dn, int *drc_index, |
213 | char **drc_name, char **drc_type, int *drc_power_domain) | 213 | char **drc_name, char **drc_type, int *drc_power_domain) |
214 | { | 214 | { |
215 | int *indexes, *names; | 215 | const int *indexes, *names; |
216 | int *types, *domains; | 216 | const int *types, *domains; |
217 | unsigned int *my_index; | 217 | const unsigned int *my_index; |
218 | char *name_tmp, *type_tmp; | 218 | char *name_tmp, *type_tmp; |
219 | int i, rc; | 219 | int i, rc; |
220 | 220 | ||
221 | my_index = (int *) get_property(dn, "ibm,my-drc-index", NULL); | 221 | my_index = get_property(dn, "ibm,my-drc-index", NULL); |
222 | if (!my_index) { | 222 | if (!my_index) { |
223 | /* Node isn't DLPAR/hotplug capable */ | 223 | /* Node isn't DLPAR/hotplug capable */ |
224 | return -EINVAL; | 224 | return -EINVAL; |
@@ -265,10 +265,10 @@ static int is_php_type(char *drc_type) | |||
265 | return 1; | 265 | return 1; |
266 | } | 266 | } |
267 | 267 | ||
268 | static int is_php_dn(struct device_node *dn, int **indexes, int **names, | 268 | static int is_php_dn(struct device_node *dn, const int **indexes, |
269 | int **types, int **power_domains) | 269 | const int **names, const int **types, const int **power_domains) |
270 | { | 270 | { |
271 | int *drc_types; | 271 | const int *drc_types; |
272 | int rc; | 272 | int rc; |
273 | 273 | ||
274 | rc = get_children_props(dn, indexes, names, &drc_types, power_domains); | 274 | rc = get_children_props(dn, indexes, names, &drc_types, power_domains); |
@@ -296,7 +296,7 @@ int rpaphp_add_slot(struct device_node *dn) | |||
296 | struct slot *slot; | 296 | struct slot *slot; |
297 | int retval = 0; | 297 | int retval = 0; |
298 | int i; | 298 | int i; |
299 | int *indexes, *names, *types, *power_domains; | 299 | const int *indexes, *names, *types, *power_domains; |
300 | char *name, *type; | 300 | char *name, *type; |
301 | 301 | ||
302 | dbg("Entry %s: dn->full_name=%s\n", __FUNCTION__, dn->full_name); | 302 | dbg("Entry %s: dn->full_name=%s\n", __FUNCTION__, dn->full_name); |