]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[SPARC64]: constify of_get_property return: arch/sparc64
authorStephen Rothwell <sfr@canb.auug.org.au>
Mon, 23 Apr 2007 22:53:27 +0000 (15:53 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 08:54:24 +0000 (01:54 -0700)
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc64/kernel/central.c
arch/sparc64/kernel/chmc.c
arch/sparc64/kernel/ebus.c
arch/sparc64/kernel/irq.c
arch/sparc64/kernel/isa.c
arch/sparc64/kernel/of_device.c
arch/sparc64/kernel/pci_sun4v.c
arch/sparc64/kernel/prom.c
arch/sparc64/kernel/sbus.c
arch/sparc64/kernel/time.c
arch/sparc64/solaris/misc.c

index e724c54af02913316e648f6f19ed0f56d76a31bf..c65b2f9c98d8b775d289f4dc9b4fa22bde57533a 100644 (file)
@@ -32,7 +32,7 @@ static void central_probe_failure(int line)
 static void central_ranges_init(struct linux_central *central)
 {
        struct device_node *dp = central->prom_node;
-       void *pval;
+       const void *pval;
        int len;
        
        central->num_central_ranges = 0;
@@ -47,7 +47,7 @@ static void central_ranges_init(struct linux_central *central)
 static void fhc_ranges_init(struct linux_fhc *fhc)
 {
        struct device_node *dp = fhc->prom_node;
-       void *pval;
+       const void *pval;
        int len;
        
        fhc->num_fhc_ranges = 0;
@@ -119,7 +119,7 @@ static unsigned long prom_reg_to_paddr(struct linux_prom_registers *r)
 static void probe_other_fhcs(void)
 {
        struct device_node *dp;
-       struct linux_prom64_registers *fpregs;
+       const struct linux_prom64_registers *fpregs;
 
        for_each_node_by_name(dp, "fhc") {
                struct linux_fhc *fhc;
@@ -190,7 +190,8 @@ static void probe_clock_board(struct linux_central *central,
                              struct device_node *fp)
 {
        struct device_node *dp;
-       struct linux_prom_registers cregs[3], *pr;
+       struct linux_prom_registers cregs[3];
+       const struct linux_prom_registers *pr;
        int nslots, tmp, nregs;
 
        dp = fp->child;
@@ -299,7 +300,8 @@ static void init_all_fhc_hw(void)
 
 void central_probe(void)
 {
-       struct linux_prom_registers fpregs[6], *pr;
+       struct linux_prom_registers fpregs[6];
+       const struct linux_prom_registers *pr;
        struct linux_fhc *fhc;
        struct device_node *dp, *fp;
        int err;
index 9699abeb9907c2597b8b23bcaccf1cbe2359a04c..777d345770458358a089df7901486f048705142a 100644 (file)
@@ -343,8 +343,8 @@ static int init_one_mctrl(struct device_node *dp)
 {
        struct mctrl_info *mp = kzalloc(sizeof(*mp), GFP_KERNEL);
        int portid = of_getintprop_default(dp, "portid", -1);
-       struct linux_prom64_registers *regs;
-       void *pval;
+       const struct linux_prom64_registers *regs;
+       const void *pval;
        int len;
 
        if (!mp)
index 35bf895fdeee04bbc1b697e9554060eb2a341625..1962bfa4ef3d0cdfd4118cf1da19efac9ca5fbca 100644 (file)
@@ -285,7 +285,7 @@ static void __init fill_ebus_child(struct device_node *dp,
                                   int non_standard_regs)
 {
        struct of_device *op;
-       int *regs;
+       const int *regs;
        int i, len;
 
        dev->prom_node = dp;
index d1bb3b3f26391e16d603e4442b880e4c2f3ac410..6241e3dbbd57da010b676c43f1a744357a7efe42 100644 (file)
@@ -627,7 +627,7 @@ static u64 prom_limit0, prom_limit1;
 static void map_prom_timers(void)
 {
        struct device_node *dp;
-       unsigned int *addr;
+       const unsigned int *addr;
 
        /* PROM timer node hangs out in the top level of device siblings... */
        dp = of_find_node_by_path("/");
index 98721a8f8619122b56852f7f8e99c1200a9cfada..791eeb7e38737ee42acd5102bd74bffcaa3c43d6 100644 (file)
@@ -24,7 +24,7 @@ static void __init report_dev(struct sparc_isa_device *isa_dev, int child)
 
 static void __init isa_dev_get_resource(struct sparc_isa_device *isa_dev)
 {
-       struct linux_prom_registers *pregs;
+       const struct linux_prom_registers *pregs;
        unsigned long base, len;
        int prop_len;
 
index fb9bf1e4d036138214d418081c7c38d54340a060..6b8798141f2cb164cb6176fb0d06396dfe2bd3fb 100644 (file)
@@ -245,7 +245,7 @@ struct of_bus {
                                       int *addrc, int *sizec);
        int             (*map)(u32 *addr, const u32 *range,
                               int na, int ns, int pna);
-       unsigned int    (*get_flags)(u32 *addr);
+       unsigned int    (*get_flags)(const u32 *addr);
 };
 
 /*
@@ -305,7 +305,7 @@ static int of_bus_default_map(u32 *addr, const u32 *range,
        return 0;
 }
 
-static unsigned int of_bus_default_get_flags(u32 *addr)
+static unsigned int of_bus_default_get_flags(const u32 *addr)
 {
        return IORESOURCE_MEM;
 }
@@ -369,7 +369,7 @@ static int of_bus_pci_map(u32 *addr, const u32 *range,
        return 0;
 }
 
-static unsigned int of_bus_pci_get_flags(u32 *addr)
+static unsigned int of_bus_pci_get_flags(const u32 *addr)
 {
        unsigned int flags = 0;
        u32 w = addr[0];
@@ -482,7 +482,7 @@ static int __init build_one_resource(struct device_node *parent,
                                     u32 *addr,
                                     int na, int ns, int pna)
 {
-       u32 *ranges;
+       const u32 *ranges;
        unsigned int rlen;
        int rone;
 
@@ -513,7 +513,7 @@ static int __init build_one_resource(struct device_node *parent,
 
 static int __init use_1to1_mapping(struct device_node *pp)
 {
-       char *model;
+       const char *model;
 
        /* If this is on the PMU bus, don't try to translate it even
         * if a ranges property exists.
@@ -548,7 +548,7 @@ static void __init build_device_resources(struct of_device *op,
        struct of_bus *bus;
        int na, ns;
        int index, num_reg;
-       void *preg;
+       const void *preg;
 
        if (!parent)
                return;
@@ -578,7 +578,7 @@ static void __init build_device_resources(struct of_device *op,
        for (index = 0; index < num_reg; index++) {
                struct resource *r = &op->resource[index];
                u32 addr[OF_MAX_ADDR_CELLS];
-               u32 *reg = (preg + (index * ((na + ns) * 4)));
+               const u32 *reg = (preg + (index * ((na + ns) * 4)));
                struct device_node *dp = op->node;
                struct device_node *pp = p_op->node;
                struct of_bus *pbus, *dbus;
@@ -643,14 +643,14 @@ static void __init build_device_resources(struct of_device *op,
 
 static struct device_node * __init
 apply_interrupt_map(struct device_node *dp, struct device_node *pp,
-                   u32 *imap, int imlen, u32 *imask,
+                   const u32 *imap, int imlen, const u32 *imask,
                    unsigned int *irq_p)
 {
        struct device_node *cp;
        unsigned int irq = *irq_p;
        struct of_bus *bus;
        phandle handle;
-       u32 *reg;
+       const u32 *reg;
        int na, num_reg, i;
 
        bus = of_match_bus(pp);
@@ -705,7 +705,7 @@ static unsigned int __init pci_irq_swizzle(struct device_node *dp,
                                           struct device_node *pp,
                                           unsigned int irq)
 {
-       struct linux_prom_pci_registers *regs;
+       const struct linux_prom_pci_registers *regs;
        unsigned int bus, devfn, slot, ret;
 
        if (irq < 1 || irq > 4)
@@ -794,7 +794,7 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
        pp = dp->parent;
        ip = NULL;
        while (pp) {
-               void *imap, *imsk;
+               const void *imap, *imsk;
                int imlen;
 
                imap = of_get_property(pp, "interrupt-map", &imlen);
@@ -859,7 +859,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
                                                 struct device *parent)
 {
        struct of_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
-       unsigned int *irq;
+       const unsigned int *irq;
        int len, i;
 
        if (!op)
index ec22cd61ec8ce8eeab6689a6de6ff4d04efc948d..bd74c155519e5f14bf0651a6f403730adfe93f42 100644 (file)
@@ -1281,7 +1281,7 @@ h_error:
 
 static void pci_sun4v_msi_init(struct pci_pbm_info *pbm)
 {
-       u32 *val;
+       const u32 *val;
        int len;
 
        val = of_get_property(pbm->prom_node, "#msi-eqs", &len);
@@ -1289,16 +1289,16 @@ static void pci_sun4v_msi_init(struct pci_pbm_info *pbm)
                goto no_msi;
        pbm->msiq_num = *val;
        if (pbm->msiq_num) {
-               struct msiq_prop {
+               const struct msiq_prop {
                        u32 first_msiq;
                        u32 num_msiq;
                        u32 first_devino;
                } *mqp;
-               struct msi_range_prop {
+               const struct msi_range_prop {
                        u32 first_msi;
                        u32 num_msi;
                } *mrng;
-               struct addr_range_prop {
+               const struct addr_range_prop {
                        u32 msi32_high;
                        u32 msi32_low;
                        u32 msi32_len;
index 0917c24c4f08fe993967b64ae35ff89466185731..25b70368973cc0b2cd338bee41b73eb8b6b0cfca 100644 (file)
@@ -196,7 +196,7 @@ EXPORT_SYMBOL(of_getintprop_default);
 
 int of_n_addr_cells(struct device_node *np)
 {
-       int* ip;
+       const int* ip;
        do {
                if (np->parent)
                        np = np->parent;
@@ -211,7 +211,7 @@ EXPORT_SYMBOL(of_n_addr_cells);
 
 int of_n_size_cells(struct device_node *np)
 {
-       int* ip;
+       const int* ip;
        do {
                if (np->parent)
                        np = np->parent;
@@ -397,7 +397,7 @@ static unsigned int psycho_irq_build(struct device_node *dp,
 
 static void psycho_irq_trans_init(struct device_node *dp)
 {
-       struct linux_prom64_registers *regs;
+       const struct linux_prom64_registers *regs;
 
        dp->irq_trans = prom_early_alloc(sizeof(struct of_irq_controller));
        dp->irq_trans->irq_build = psycho_irq_build;
@@ -547,7 +547,7 @@ static unsigned long __sabre_onboard_imap_off[] = {
 static int sabre_device_needs_wsync(struct device_node *dp)
 {
        struct device_node *parent = dp->parent;
-       char *parent_model, *parent_compat;
+       const char *parent_model, *parent_compat;
 
        /* This traversal up towards the root is meant to
         * handle two cases:
@@ -589,7 +589,7 @@ static unsigned int sabre_irq_build(struct device_node *dp,
 {
        struct sabre_irq_data *irq_data = _data;
        unsigned long controller_regs = irq_data->controller_regs;
-       struct linux_prom_pci_registers *regs;
+       const struct linux_prom_pci_registers *regs;
        unsigned long imap, iclr;
        unsigned long imap_off, iclr_off;
        int inofixup = 0;
@@ -639,9 +639,9 @@ static unsigned int sabre_irq_build(struct device_node *dp,
 
 static void sabre_irq_trans_init(struct device_node *dp)
 {
-       struct linux_prom64_registers *regs;
+       const struct linux_prom64_registers *regs;
        struct sabre_irq_data *irq_data;
-       u32 *busrange;
+       const u32 *busrange;
 
        dp->irq_trans = prom_early_alloc(sizeof(struct of_irq_controller));
        dp->irq_trans->irq_build = sabre_irq_build;
@@ -795,7 +795,7 @@ static unsigned int schizo_irq_build(struct device_node *dp,
 
 static void __schizo_irq_trans_init(struct device_node *dp, int is_tomatillo)
 {
-       struct linux_prom64_registers *regs;
+       const struct linux_prom64_registers *regs;
        struct schizo_irq_data *irq_data;
 
        dp->irq_trans = prom_early_alloc(sizeof(struct of_irq_controller));
@@ -836,7 +836,7 @@ static unsigned int pci_sun4v_irq_build(struct device_node *dp,
 
 static void pci_sun4v_irq_trans_init(struct device_node *dp)
 {
-       struct linux_prom64_registers *regs;
+       const struct linux_prom64_registers *regs;
 
        dp->irq_trans = prom_early_alloc(sizeof(struct of_irq_controller));
        dp->irq_trans->irq_build = pci_sun4v_irq_build;
@@ -940,7 +940,7 @@ static unsigned int sbus_of_build_irq(struct device_node *dp,
                                      void *_data)
 {
        unsigned long reg_base = (unsigned long) _data;
-       struct linux_prom_registers *regs;
+       const struct linux_prom_registers *regs;
        unsigned long imap, iclr;
        int sbus_slot = 0;
        int sbus_level = 0;
@@ -994,7 +994,7 @@ static unsigned int sbus_of_build_irq(struct device_node *dp,
 
 static void sbus_irq_trans_init(struct device_node *dp)
 {
-       struct linux_prom64_registers *regs;
+       const struct linux_prom64_registers *regs;
 
        dp->irq_trans = prom_early_alloc(sizeof(struct of_irq_controller));
        dp->irq_trans->irq_build = sbus_of_build_irq;
@@ -1080,7 +1080,7 @@ static unsigned int sun4v_vdev_irq_build(struct device_node *dp,
 
 static void sun4v_vdev_irq_trans_init(struct device_node *dp)
 {
-       struct linux_prom64_registers *regs;
+       const struct linux_prom64_registers *regs;
 
        dp->irq_trans = prom_early_alloc(sizeof(struct of_irq_controller));
        dp->irq_trans->irq_build = sun4v_vdev_irq_build;
index 14f78fb5e890e8dfff2cbe49469ce5313e26cbd9..d403f3df2dc28b22ed155cafd48e2ce7e51699bc 100644 (file)
@@ -1025,7 +1025,7 @@ static void __init sysio_register_error_handlers(struct sbus_bus *sbus)
 /* Boot time initialization. */
 static void __init sbus_iommu_init(int __node, struct sbus_bus *sbus)
 {
-       struct linux_prom64_registers *pr;
+       const struct linux_prom64_registers *pr;
        struct device_node *dp;
        struct sbus_iommu *iommu;
        unsigned long regs;
@@ -1133,7 +1133,7 @@ static void __init sbus_iommu_init(int __node, struct sbus_bus *sbus)
 void sbus_fill_device_irq(struct sbus_dev *sdev)
 {
        struct device_node *dp = of_find_node_by_phandle(sdev->prom_node);
-       struct linux_prom_irqs *irqs;
+       const struct linux_prom_irqs *irqs;
 
        irqs = of_get_property(dp, "interrupts", NULL);
        if (!irqs) {
index 3cb761ec89538798e9369219ad19791828f48db0..259063f41f952273fa0681b82d12b8bb466f1889 100644 (file)
@@ -704,7 +704,7 @@ retry:
        return -EOPNOTSUPP;
 }
 
-static int __init clock_model_matches(char *model)
+static int __init clock_model_matches(const char *model)
 {
        if (strcmp(model, "mk48t02") &&
            strcmp(model, "mk48t08") &&
@@ -721,7 +721,7 @@ static int __init clock_model_matches(char *model)
 static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match)
 {
        struct device_node *dp = op->node;
-       char *model = of_get_property(dp, "model", NULL);
+       const char *model = of_get_property(dp, "model", NULL);
        unsigned long size, flags;
        void __iomem *regs;
 
index 9fcaad6dd11fad2297b342ced72937dd77a555d4..542c808ec2c83c7b411982610f6e793358105de5 100644 (file)
@@ -224,7 +224,8 @@ static char *serial(char *buffer, int sz)
 
        *buffer = 0;
        if (dp) {
-               char *val = of_get_property(dp, "system-board-serial#", &len);
+               const char *val =
+                       of_get_property(dp, "system-board-serial#", &len);
 
                if (val && len > 0) {
                        if (len > sz)