Commit 8efca49329a50710d656a8bb78d6f0f0e2f48a26

Authored by Jeremy Kerr
Committed by Paul Mackerras
1 parent c4c7cba90c

[POWERPC] mpc: 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.

mpc* platform changes.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>

Showing 9 changed files with 20 additions and 20 deletions Side-by-side Diff

arch/powerpc/platforms/83xx/mpc834x_itx.c
... ... @@ -80,8 +80,8 @@
80 80  
81 81 np = of_find_node_by_type(NULL, "cpu");
82 82 if (np != 0) {
83   - unsigned int *fp =
84   - (int *)get_property(np, "clock-frequency", NULL);
  83 + const unsigned int *fp =
  84 + get_property(np, "clock-frequency", NULL);
85 85 if (fp != 0)
86 86 loops_per_jiffy = *fp / HZ;
87 87 else
arch/powerpc/platforms/83xx/mpc834x_sys.c
... ... @@ -84,8 +84,8 @@
84 84  
85 85 np = of_find_node_by_type(NULL, "cpu");
86 86 if (np != 0) {
87   - unsigned int *fp =
88   - (int *)get_property(np, "clock-frequency", NULL);
  87 + const unsigned int *fp =
  88 + get_property(np, "clock-frequency", NULL);
89 89 if (fp != 0)
90 90 loops_per_jiffy = *fp / HZ;
91 91 else
arch/powerpc/platforms/83xx/pci.c
... ... @@ -50,7 +50,7 @@
50 50 int len;
51 51 struct pci_controller *hose;
52 52 struct resource rsrc;
53   - int *bus_range;
  53 + const int *bus_range;
54 54 int primary = 1, has_address = 0;
55 55 phys_addr_t immr = get_immrbase();
56 56  
... ... @@ -60,7 +60,7 @@
60 60 has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
61 61  
62 62 /* Get bus range if any */
63   - bus_range = (int *)get_property(dev, "bus-range", &len);
  63 + bus_range = get_property(dev, "bus-range", &len);
64 64 if (bus_range == NULL || len < 2 * sizeof(int)) {
65 65 printk(KERN_WARNING "Can't get bus-range for %s, assume"
66 66 " bus 0\n", dev->full_name);
arch/powerpc/platforms/85xx/mpc85xx_ads.c
... ... @@ -172,9 +172,9 @@
172 172  
173 173 cpu = of_find_node_by_type(NULL, "cpu");
174 174 if (cpu != 0) {
175   - unsigned int *fp;
  175 + const unsigned int *fp;
176 176  
177   - fp = (int *)get_property(cpu, "clock-frequency", NULL);
  177 + fp = get_property(cpu, "clock-frequency", NULL);
178 178 if (fp != 0)
179 179 loops_per_jiffy = *fp / HZ;
180 180 else
arch/powerpc/platforms/85xx/mpc85xx_cds.c
... ... @@ -273,9 +273,9 @@
273 273  
274 274 cpu = of_find_node_by_type(NULL, "cpu");
275 275 if (cpu != 0) {
276   - unsigned int *fp;
  276 + const unsigned int *fp;
277 277  
278   - fp = (int *)get_property(cpu, "clock-frequency", NULL);
  278 + fp = get_property(cpu, "clock-frequency", NULL);
279 279 if (fp != 0)
280 280 loops_per_jiffy = *fp / HZ;
281 281 else
arch/powerpc/platforms/85xx/pci.c
... ... @@ -41,7 +41,7 @@
41 41 int len;
42 42 struct pci_controller *hose;
43 43 struct resource rsrc;
44   - int *bus_range;
  44 + const int *bus_range;
45 45 int primary = 1, has_address = 0;
46 46 phys_addr_t immr = get_immrbase();
47 47  
... ... @@ -51,7 +51,7 @@
51 51 has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
52 52  
53 53 /* Get bus range if any */
54   - bus_range = (int *) get_property(dev, "bus-range", &len);
  54 + bus_range = get_property(dev, "bus-range", &len);
55 55 if (bus_range == NULL || len < 2 * sizeof(int)) {
56 56 printk(KERN_WARNING "Can't get bus-range for %s, assume"
57 57 " bus 0\n", dev->full_name);
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
... ... @@ -323,9 +323,9 @@
323 323  
324 324 np = of_find_node_by_type(NULL, "cpu");
325 325 if (np != 0) {
326   - unsigned int *fp;
  326 + const unsigned int *fp;
327 327  
328   - fp = (int *)get_property(np, "clock-frequency", NULL);
  328 + fp = get_property(np, "clock-frequency", NULL);
329 329 if (fp != 0)
330 330 loops_per_jiffy = *fp / HZ;
331 331 else
arch/powerpc/platforms/86xx/pci.c
... ... @@ -153,7 +153,7 @@
153 153 int len;
154 154 struct pci_controller *hose;
155 155 struct resource rsrc;
156   - int *bus_range;
  156 + const int *bus_range;
157 157 int has_address = 0;
158 158 int primary = 0;
159 159  
... ... @@ -163,7 +163,7 @@
163 163 has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
164 164  
165 165 /* Get bus range if any */
166   - bus_range = (int *) get_property(dev, "bus-range", &len);
  166 + bus_range = get_property(dev, "bus-range", &len);
167 167 if (bus_range == NULL || len < 2 * sizeof(int))
168 168 printk(KERN_WARNING "Can't get bus-range for %s, assume"
169 169 " bus 0\n", dev->full_name);
arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
... ... @@ -130,7 +130,7 @@
130 130 {
131 131 struct pci_controller *hose;
132 132 struct device_node *node;
133   - unsigned int *interrupt;
  133 + const unsigned int *interrupt;
134 134 int busnr;
135 135 int len;
136 136 u8 slot;
... ... @@ -147,7 +147,7 @@
147 147 if (!node)
148 148 printk(KERN_ERR "No pci node found\n");
149 149  
150   - interrupt = (unsigned int *) get_property(node, "interrupt-map", &len);
  150 + interrupt = get_property(node, "interrupt-map", &len);
151 151 slot = find_slot_by_devfn(interrupt, dev->devfn);
152 152 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
153 153 if (pin == 0 || pin > 4)
154 154  
... ... @@ -176,9 +176,9 @@
176 176  
177 177 cpu = of_find_node_by_type(NULL, "cpu");
178 178 if (cpu != 0) {
179   - unsigned int *fp;
  179 + const unsigned int *fp;
180 180  
181   - fp = (int *)get_property(cpu, "clock-frequency", NULL);
  181 + fp = get_property(cpu, "clock-frequency", NULL);
182 182 if (fp != 0)
183 183 loops_per_jiffy = *fp / HZ;
184 184 else