]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[POWERPC] mpc: Constify & voidify get_property()
authorJeremy Kerr <jk@ozlabs.org>
Wed, 12 Jul 2006 05:39:42 +0000 (15:39 +1000)
committerPaul Mackerras <paulus@samba.org>
Mon, 31 Jul 2006 05:55:04 +0000 (15:55 +1000)
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>
arch/powerpc/platforms/83xx/mpc834x_itx.c
arch/powerpc/platforms/83xx/mpc834x_sys.c
arch/powerpc/platforms/83xx/pci.c
arch/powerpc/platforms/85xx/mpc85xx_ads.c
arch/powerpc/platforms/85xx/mpc85xx_cds.c
arch/powerpc/platforms/85xx/pci.c
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
arch/powerpc/platforms/86xx/pci.c
arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c

index b46305645d381535f73347984688c09c1e4f0eaa..d9675f9b9766fce60f52c899099378085dc91a4e 100644 (file)
@@ -80,8 +80,8 @@ static void __init mpc834x_itx_setup_arch(void)
 
        np = of_find_node_by_type(NULL, "cpu");
        if (np != 0) {
-               unsigned int *fp =
-                   (int *)get_property(np, "clock-frequency", NULL);
+               const unsigned int *fp =
+                       get_property(np, "clock-frequency", NULL);
                if (fp != 0)
                        loops_per_jiffy = *fp / HZ;
                else
index 3e1c16eb4a639bf8d03f63614b674500d34e087b..5eadf9d035f13d27d46f59787d6edcb643c1fc13 100644 (file)
@@ -84,8 +84,8 @@ static void __init mpc834x_sys_setup_arch(void)
 
        np = of_find_node_by_type(NULL, "cpu");
        if (np != 0) {
-               unsigned int *fp =
-                   (int *)get_property(np, "clock-frequency", NULL);
+               const unsigned int *fp =
+                       get_property(np, "clock-frequency", NULL);
                if (fp != 0)
                        loops_per_jiffy = *fp / HZ;
                else
index 3b5e563c279f97c32544da364a64670ea10789fb..9c3650555144d91b8a4d9ebdd8a9a0915ad2263c 100644 (file)
@@ -50,7 +50,7 @@ int __init add_bridge(struct device_node *dev)
        int len;
        struct pci_controller *hose;
        struct resource rsrc;
-       int *bus_range;
+       const int *bus_range;
        int primary = 1, has_address = 0;
        phys_addr_t immr = get_immrbase();
 
@@ -60,7 +60,7 @@ int __init add_bridge(struct device_node *dev)
        has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
 
        /* Get bus range if any */
-       bus_range = (int *)get_property(dev, "bus-range", &len);
+       bus_range = get_property(dev, "bus-range", &len);
        if (bus_range == NULL || len < 2 * sizeof(int)) {
                printk(KERN_WARNING "Can't get bus-range for %s, assume"
                       " bus 0\n", dev->full_name);
index 06a497676c992f5a7f2ab59af3309b0c24f72f61..d0cfcdb1d1b5aca0afc0fac41d3194dfb60823e4 100644 (file)
@@ -172,9 +172,9 @@ static void __init mpc85xx_ads_setup_arch(void)
 
        cpu = of_find_node_by_type(NULL, "cpu");
        if (cpu != 0) {
-               unsigned int *fp;
+               const unsigned int *fp;
 
-               fp = (int *)get_property(cpu, "clock-frequency", NULL);
+               fp = get_property(cpu, "clock-frequency", NULL);
                if (fp != 0)
                        loops_per_jiffy = *fp / HZ;
                else
index 18e6e11f70202f1a0ad303442bdc780cee6d1231..5fd53eba6912d3d21fb089c7b3f17401e79e12d8 100644 (file)
@@ -273,9 +273,9 @@ mpc85xx_cds_setup_arch(void)
 
        cpu = of_find_node_by_type(NULL, "cpu");
        if (cpu != 0) {
-               unsigned int *fp;
+               const unsigned int *fp;
 
-               fp = (int *)get_property(cpu, "clock-frequency", NULL);
+               fp = get_property(cpu, "clock-frequency", NULL);
                if (fp != 0)
                        loops_per_jiffy = *fp / HZ;
                else
index 1d51f3242ab1be40b768c7505610109139e0aec8..05930eeb6e7f8c53886235f16cdbb056611700d9 100644 (file)
@@ -41,7 +41,7 @@ int __init add_bridge(struct device_node *dev)
        int len;
        struct pci_controller *hose;
        struct resource rsrc;
-       int *bus_range;
+       const int *bus_range;
        int primary = 1, has_address = 0;
        phys_addr_t immr = get_immrbase();
 
@@ -51,7 +51,7 @@ int __init add_bridge(struct device_node *dev)
        has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
 
        /* Get bus range if any */
-       bus_range = (int *) get_property(dev, "bus-range", &len);
+       bus_range = get_property(dev, "bus-range", &len);
        if (bus_range == NULL || len < 2 * sizeof(int)) {
                printk(KERN_WARNING "Can't get bus-range for %s, assume"
                       " bus 0\n", dev->full_name);
index ebae73eb00630f460a926e9b56dfbf004cd1756d..839090682ab210c7e4f48c1aa50749ed8e8774b8 100644 (file)
@@ -323,9 +323,9 @@ mpc86xx_hpcn_setup_arch(void)
 
        np = of_find_node_by_type(NULL, "cpu");
        if (np != 0) {
-               unsigned int *fp;
+               const unsigned int *fp;
 
-               fp = (int *)get_property(np, "clock-frequency", NULL);
+               fp = get_property(np, "clock-frequency", NULL);
                if (fp != 0)
                        loops_per_jiffy = *fp / HZ;
                else
index bc5139043112e934f340b2691dabddadad355abc..d7050c1108ff1bbcc0d6ba8dadef37f9ca6057ee 100644 (file)
@@ -153,7 +153,7 @@ int __init add_bridge(struct device_node *dev)
        int len;
        struct pci_controller *hose;
        struct resource rsrc;
-       int *bus_range;
+       const int *bus_range;
        int has_address = 0;
        int primary = 0;
 
@@ -163,7 +163,7 @@ int __init add_bridge(struct device_node *dev)
        has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
 
        /* Get bus range if any */
-       bus_range = (int *) get_property(dev, "bus-range", &len);
+       bus_range = get_property(dev, "bus-range", &len);
        if (bus_range == NULL || len < 2 * sizeof(int))
                printk(KERN_WARNING "Can't get bus-range for %s, assume"
                       " bus 0\n", dev->full_name);
index d7a4fc7ca238a211cacaa546b97aec47c634ff2f..69c998cb4f1b9a854e0e61cc308108f9b9b09984 100644 (file)
@@ -130,7 +130,7 @@ void mpc7448_hpc2_fixup_irq(struct pci_dev *dev)
 {
        struct pci_controller *hose;
        struct device_node *node;
-       unsigned int *interrupt;
+       const unsigned int *interrupt;
        int busnr;
        int len;
        u8 slot;
@@ -147,7 +147,7 @@ void mpc7448_hpc2_fixup_irq(struct pci_dev *dev)
        if (!node)
                printk(KERN_ERR "No pci node found\n");
 
-       interrupt = (unsigned int *) get_property(node, "interrupt-map", &len);
+       interrupt = get_property(node, "interrupt-map", &len);
        slot = find_slot_by_devfn(interrupt, dev->devfn);
        pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
        if (pin == 0 || pin > 4)
@@ -176,9 +176,9 @@ static void __init mpc7448_hpc2_setup_arch(void)
 
        cpu = of_find_node_by_type(NULL, "cpu");
        if (cpu != 0) {
-               unsigned int *fp;
+               const unsigned int *fp;
 
-               fp = (int *)get_property(cpu, "clock-frequency", NULL);
+               fp = get_property(cpu, "clock-frequency", NULL);
                if (fp != 0)
                        loops_per_jiffy = *fp / HZ;
                else