Skip to content

Commit ccf0dec

Browse files
sfrothwellDavid S. Miller
authored andcommitted
[SPARC/64] constify of_get_property return: drivers
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>
1 parent 6a23acf commit ccf0dec

12 files changed

Lines changed: 21 additions & 21 deletions

File tree

‎drivers/mtd/maps/sun_uflash.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ MODULE_VERSION("2.0");
3939

4040
static LIST_HEAD(device_list);
4141
struct uflash_dev {
42-
char *name; /* device name */
42+
const char *name; /* device name */
4343
struct map_info map; /* mtd map info */
4444
struct mtd_info *mtd; /* mtd info */
4545
};
@@ -80,7 +80,7 @@ int uflash_devinit(struct linux_ebus_device *edev, struct device_node *dp)
8080

8181
up->name = of_get_property(dp, "model", NULL);
8282
if (up->name && 0 < strlen(up->name))
83-
up->map.name = up->name;
83+
up->map.name = (char *)up->name;
8484

8585
up->map.phys = res->start;
8686

‎drivers/net/sungem.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2914,7 +2914,7 @@ static int __devinit gem_get_device_address(struct gem *gp)
29142914
int use_idprom = 1;
29152915

29162916
if (pcp != NULL) {
2917-
unsigned char *addr;
2917+
const unsigned char *addr;
29182918
int len;
29192919

29202920
addr = of_get_property(pcp->prom_node, "local-mac-address",

‎drivers/net/sunhme.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2704,7 +2704,7 @@ static int __devinit happy_meal_sbus_probe_one(struct sbus_dev *sdev, int is_qfe
27042704
dev->dev_addr[i] = macaddr[i];
27052705
macaddr[5]++;
27062706
} else {
2707-
unsigned char *addr;
2707+
const unsigned char *addr;
27082708
int len;
27092709

27102710
addr = of_get_property(dp, "local-mac-address", &len);
@@ -3081,7 +3081,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
30813081
macaddr[5]++;
30823082
} else {
30833083
#ifdef CONFIG_SPARC
3084-
unsigned char *addr;
3084+
const unsigned char *addr;
30853085
int len;
30863086

30873087
if (qfe_slot != -1 &&
@@ -3300,7 +3300,7 @@ static int __devinit hme_sbus_probe(struct of_device *dev, const struct of_devic
33003300
{
33013301
struct sbus_dev *sdev = to_sbus_device(&dev->dev);
33023302
struct device_node *dp = dev->node;
3303-
char *model = of_get_property(dp, "model", NULL);
3303+
const char *model = of_get_property(dp, "model", NULL);
33043304
int is_qfe = (match->data != NULL);
33053305

33063306
if (!is_qfe && model && !strcmp(model, "SUNW,sbus-qfe"))

‎drivers/net/tg3.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10996,7 +10996,7 @@ static int __devinit tg3_get_macaddr_sparc(struct tg3 *tp)
1099610996
struct pcidev_cookie *pcp = pdev->sysdata;
1099710997

1099810998
if (pcp != NULL) {
10999-
unsigned char *addr;
10999+
const unsigned char *addr;
1100011000
int len;
1100111001

1100211002
addr = of_get_property(pcp->prom_node, "local-mac-address",

‎drivers/net/tulip/tulip_core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
15441544
dev->dev_addr[i] = last_phys_addr[i] + 1;
15451545
#if defined(__sparc__)
15461546
if (pcp) {
1547-
unsigned char *addr;
1547+
const unsigned char *addr;
15481548
int len;
15491549

15501550
addr = of_get_property(pcp->prom_node,

‎drivers/sbus/char/envctrl.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ static struct miscdevice envctrl_dev = {
726726
* Return: None.
727727
*/
728728
static void envctrl_set_mon(struct i2c_child_t *pchild,
729-
char *chnl_desc,
729+
const char *chnl_desc,
730730
int chnl_no)
731731
{
732732
/* Firmware only has temperature type. It does not distinguish
@@ -763,8 +763,8 @@ static void envctrl_set_mon(struct i2c_child_t *pchild,
763763
static void envctrl_init_adc(struct i2c_child_t *pchild, struct device_node *dp)
764764
{
765765
int i = 0, len;
766-
char *pos;
767-
unsigned int *pval;
766+
const char *pos;
767+
const unsigned int *pval;
768768

769769
/* Firmware describe channels into a stream separated by a '\0'. */
770770
pos = of_get_property(dp, "channels-description", &len);
@@ -859,7 +859,7 @@ static void envctrl_init_i2c_child(struct linux_ebus_child *edev_child,
859859
{
860860
int len, i, tbls_size = 0;
861861
struct device_node *dp = edev_child->prom_node;
862-
void *pval;
862+
const void *pval;
863863

864864
/* Get device address. */
865865
pval = of_get_property(dp, "reg", &len);

‎drivers/sbus/char/flash.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ static int __init flash_init(void)
190190
}
191191
if (!sdev) {
192192
#ifdef CONFIG_PCI
193-
struct linux_prom_registers *ebus_regs;
193+
const struct linux_prom_registers *ebus_regs;
194194

195195
for_each_ebus(ebus) {
196196
for_each_ebusdev(edev, ebus) {

‎drivers/sbus/char/openprom.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static int copyout(void __user *info, struct openpromio *opp, int len)
141141

142142
static int opromgetprop(void __user *argp, struct device_node *dp, struct openpromio *op, int bufsize)
143143
{
144-
void *pval;
144+
const void *pval;
145145
int len;
146146

147147
if (!dp ||
@@ -410,7 +410,7 @@ static int opiocget(void __user *argp, DATA *data)
410410
struct opiocdesc op;
411411
struct device_node *dp;
412412
char *str;
413-
void *pval;
413+
const void *pval;
414414
int err, len;
415415

416416
if (copy_from_user(&op, argp, sizeof(op)))

‎drivers/sbus/sbus.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct sbus_bus *sbus_root;
3535
static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sdev)
3636
{
3737
unsigned long base;
38-
void *pval;
38+
const void *pval;
3939
int len, err;
4040

4141
sdev->prom_node = dp->node;
@@ -86,7 +86,7 @@ static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sde
8686

8787
static void __init sbus_bus_ranges_init(struct device_node *dp, struct sbus_bus *sbus)
8888
{
89-
void *pval;
89+
const void *pval;
9090
int len;
9191

9292
pval = of_get_property(dp, "ranges", &len);

‎drivers/scsi/qlogicpti.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,7 @@ static int __devinit qpti_sbus_probe(struct of_device *dev, const struct of_devi
14031403
struct scsi_host_template *tpnt = match->data;
14041404
struct Scsi_Host *host;
14051405
struct qlogicpti *qpti;
1406-
char *fcode;
1406+
const char *fcode;
14071407

14081408
/* Sometimes Antares cards come up not completely
14091409
* setup, and we get a report of a zero IRQ.

0 commit comments

Comments
 (0)