]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[SPARC/64] constify of_get_property return: drivers
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 29 Mar 2007 07:49:54 +0000 (00:49 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 08:54:27 +0000 (01:54 -0700)
The only unfortunate bit here is that the name field of struct map_info
is not const, so for now we put a cast on the assignment of it.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 files changed:
drivers/mtd/maps/sun_uflash.c
drivers/net/sungem.c
drivers/net/sunhme.c
drivers/net/tg3.c
drivers/net/tulip/tulip_core.c
drivers/sbus/char/envctrl.c
drivers/sbus/char/flash.c
drivers/sbus/char/openprom.c
drivers/sbus/sbus.c
drivers/scsi/qlogicpti.c
drivers/serial/sunsu.c
drivers/video/cg3.c

index 4db2055cee31ef9e68967e9d56a3e4c7d4b731c6..001af7f7dddad5273164cac453f4ea3367386f91 100644 (file)
@@ -39,7 +39,7 @@ MODULE_VERSION("2.0");
 
 static LIST_HEAD(device_list);
 struct uflash_dev {
-       char                    *name;  /* device name */
+       const char              *name;  /* device name */
        struct map_info         map;    /* mtd map info */
        struct mtd_info         *mtd;   /* mtd info */
 };
@@ -80,7 +80,7 @@ int uflash_devinit(struct linux_ebus_device *edev, struct device_node *dp)
 
        up->name = of_get_property(dp, "model", NULL);
        if (up->name && 0 < strlen(up->name))
-               up->map.name = up->name;
+               up->map.name = (char *)up->name;
 
        up->map.phys = res->start;
 
index 08ea61db46fe5fae257415a54a30211202ff8990..bb07b79817f439aa6597deb115187ee4272c48f6 100644 (file)
@@ -2914,7 +2914,7 @@ static int __devinit gem_get_device_address(struct gem *gp)
        int use_idprom = 1;
 
        if (pcp != NULL) {
-               unsigned char *addr;
+               const unsigned char *addr;
                int len;
 
                addr = of_get_property(pcp->prom_node, "local-mac-address",
index 192bbc91c73189e76f2a19e6b189fd8f713c1be2..bee5e5b309b76a0e3b855964b80190d29d2c05aa 100644 (file)
@@ -2704,7 +2704,7 @@ static int __devinit happy_meal_sbus_probe_one(struct sbus_dev *sdev, int is_qfe
                        dev->dev_addr[i] = macaddr[i];
                macaddr[5]++;
        } else {
-               unsigned char *addr;
+               const unsigned char *addr;
                int len;
 
                addr = of_get_property(dp, "local-mac-address", &len);
@@ -3081,7 +3081,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
                macaddr[5]++;
        } else {
 #ifdef CONFIG_SPARC
-               unsigned char *addr;
+               const unsigned char *addr;
                int len;
 
                if (qfe_slot != -1 &&
@@ -3300,7 +3300,7 @@ static int __devinit hme_sbus_probe(struct of_device *dev, const struct of_devic
 {
        struct sbus_dev *sdev = to_sbus_device(&dev->dev);
        struct device_node *dp = dev->node;
-       char *model = of_get_property(dp, "model", NULL);
+       const char *model = of_get_property(dp, "model", NULL);
        int is_qfe = (match->data != NULL);
 
        if (!is_qfe && model && !strcmp(model, "SUNW,sbus-qfe"))
index 256969e1300c9f36fa29cff47977dd006dfde452..45b4e018b5e04c9b86881e793ff7abeae49b4e82 100644 (file)
@@ -10996,7 +10996,7 @@ static int __devinit tg3_get_macaddr_sparc(struct tg3 *tp)
        struct pcidev_cookie *pcp = pdev->sysdata;
 
        if (pcp != NULL) {
-               unsigned char *addr;
+               const unsigned char *addr;
                int len;
 
                addr = of_get_property(pcp->prom_node, "local-mac-address",
index e3774a5223723f8835d40d79146bd78be3a1972e..03c14181b6bd7bed5c3e10e4b27e7049a534eefa 100644 (file)
@@ -1544,7 +1544,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
                dev->dev_addr[i] = last_phys_addr[i] + 1;
 #if defined(__sparc__)
                if (pcp) {
-                       unsigned char *addr;
+                       const unsigned char *addr;
                        int len;
 
                        addr = of_get_property(pcp->prom_node,
index 2cea4f5d2084b13f85da8114ef554ced2c47b5d9..f2be2ead87426d7ca70443aeeb70d21b5eedb55d 100644 (file)
@@ -726,7 +726,7 @@ static struct miscdevice envctrl_dev = {
  * Return: None.
  */
 static void envctrl_set_mon(struct i2c_child_t *pchild,
-                           char *chnl_desc,
+                           const char *chnl_desc,
                            int chnl_no)
 {
        /* Firmware only has temperature type.  It does not distinguish
@@ -763,8 +763,8 @@ static void envctrl_set_mon(struct i2c_child_t *pchild,
 static void envctrl_init_adc(struct i2c_child_t *pchild, struct device_node *dp)
 {
        int i = 0, len;
-       char *pos;
-       unsigned int *pval;
+       const char *pos;
+       const unsigned int *pval;
 
        /* Firmware describe channels into a stream separated by a '\0'. */
        pos = of_get_property(dp, "channels-description", &len);
@@ -859,7 +859,7 @@ static void envctrl_init_i2c_child(struct linux_ebus_child *edev_child,
 {
        int len, i, tbls_size = 0;
        struct device_node *dp = edev_child->prom_node;
-       void *pval;
+       const void *pval;
 
        /* Get device address. */
        pval = of_get_property(dp, "reg", &len);
index 6e99507aeb12c23fba03c52a56697f58d0d216c9..262f01e68592f4b359cef0d7c0743673cb237049 100644 (file)
@@ -190,7 +190,7 @@ static int __init flash_init(void)
        }
        if (!sdev) {
 #ifdef CONFIG_PCI
-               struct linux_prom_registers *ebus_regs;
+               const struct linux_prom_registers *ebus_regs;
 
                for_each_ebus(ebus) {
                        for_each_ebusdev(edev, ebus) {
index 5041c9dfbe3b9e70158a7c31063da2d64936b290..aec3b9f991f6dc981ab43b65c889c8c41b9e02ae 100644 (file)
@@ -141,7 +141,7 @@ static int copyout(void __user *info, struct openpromio *opp, int len)
 
 static int opromgetprop(void __user *argp, struct device_node *dp, struct openpromio *op, int bufsize)
 {
-       void *pval;
+       const void *pval;
        int len;
 
        if (!dp ||
@@ -410,7 +410,7 @@ static int opiocget(void __user *argp, DATA *data)
        struct opiocdesc op;
        struct device_node *dp;
        char *str;
-       void *pval;
+       const void *pval;
        int err, len;
 
        if (copy_from_user(&op, argp, sizeof(op)))
index 6349dd617f85cdd8807288597feda9d0cf736834..eee590a51d8a4a1e957d2bbbe177923792de0295 100644 (file)
@@ -35,7 +35,7 @@ struct sbus_bus *sbus_root;
 static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sdev)
 {
        unsigned long base;
-       void *pval;
+       const void *pval;
        int len, err;
 
        sdev->prom_node = dp->node;
@@ -86,7 +86,7 @@ static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sde
 
 static void __init sbus_bus_ranges_init(struct device_node *dp, struct sbus_bus *sbus)
 {
-       void *pval;
+       const void *pval;
        int len;
 
        pval = of_get_property(dp, "ranges", &len);
index 9f10689905a8d68c3eb7be4b00561c52f7f6ac23..c4195ea869e9a4b54e08588737dd83d3be20bbc1 100644 (file)
@@ -1403,7 +1403,7 @@ static int __devinit qpti_sbus_probe(struct of_device *dev, const struct of_devi
        struct scsi_host_template *tpnt = match->data;
        struct Scsi_Host *host;
        struct qlogicpti *qpti;
-       char *fcode;
+       const char *fcode;
 
        /* Sometimes Antares cards come up not completely
         * setup, and we get a report of a zero IRQ.
index 96a852aa1903a87e6a888cda7c61587464ab1611..bfd44177a2152cd9f9d078cecd5c559ad350f4dd 100644 (file)
@@ -1387,8 +1387,8 @@ static enum su_type __devinit su_get_type(struct device_node *dp)
        struct device_node *ap = of_find_node_by_path("/aliases");
 
        if (ap) {
-               char *keyb = of_get_property(ap, "keyboard", NULL);
-               char *ms = of_get_property(ap, "mouse", NULL);
+               const char *keyb = of_get_property(ap, "keyboard", NULL);
+               const char *ms = of_get_property(ap, "mouse", NULL);
 
                if (keyb) {
                        if (dp == of_find_node_by_path(keyb))
index 767c850f8eb729abd9e73779db0e9edc45c3366f..f042428a84f4485214a5ca1d95c38001bf0d9e8a 100644 (file)
@@ -266,7 +266,7 @@ static void __devinit cg3_init_fix(struct fb_info *info, int linebytes,
 static void __devinit cg3_rdi_maybe_fixup_var(struct fb_var_screeninfo *var,
                                              struct device_node *dp)
 {
-       char *params;
+       const char *params;
        char *p;
        int ww, hh;