aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2006-07-12 01:41:03 -0400
committerPaul Mackerras <paulus@samba.org>2006-07-31 01:55:05 -0400
commit1a2509c946bfd4d4a4c5a6e816082d3a7de45db8 (patch)
tree1a99101fe9be656b928272925102c602e6650562 /drivers/net
parent294ef16a2ee34d0d94aa63616f7552d3bc66c982 (diff)
[POWERPC] netdevices: 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. powerpc-specific network device driver changes. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bmac.c13
-rw-r--r--drivers/net/mace.c2
-rw-r--r--drivers/net/spider_net.c12
-rw-r--r--drivers/net/sungem.c2
4 files changed, 16 insertions, 13 deletions
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c
index 6fad83f24c4f..711609665632 100644
--- a/drivers/net/bmac.c
+++ b/drivers/net/bmac.c
@@ -1264,7 +1264,8 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i
1264{ 1264{
1265 int j, rev, ret; 1265 int j, rev, ret;
1266 struct bmac_data *bp; 1266 struct bmac_data *bp;
1267 unsigned char *addr; 1267 const unsigned char *prop_addr;
1268 unsigned char addr[6];
1268 struct net_device *dev; 1269 struct net_device *dev;
1269 int is_bmac_plus = ((int)match->data) != 0; 1270 int is_bmac_plus = ((int)match->data) != 0;
1270 1271
@@ -1272,14 +1273,16 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i
1272 printk(KERN_ERR "BMAC: can't use, need 3 addrs and 3 intrs\n"); 1273 printk(KERN_ERR "BMAC: can't use, need 3 addrs and 3 intrs\n");
1273 return -ENODEV; 1274 return -ENODEV;
1274 } 1275 }
1275 addr = get_property(macio_get_of_node(mdev), "mac-address", NULL); 1276 prop_addr = get_property(macio_get_of_node(mdev), "mac-address", NULL);
1276 if (addr == NULL) { 1277 if (prop_addr == NULL) {
1277 addr = get_property(macio_get_of_node(mdev), "local-mac-address", NULL); 1278 prop_addr = get_property(macio_get_of_node(mdev),
1278 if (addr == NULL) { 1279 "local-mac-address", NULL);
1280 if (prop_addr == NULL) {
1279 printk(KERN_ERR "BMAC: Can't get mac-address\n"); 1281 printk(KERN_ERR "BMAC: Can't get mac-address\n");
1280 return -ENODEV; 1282 return -ENODEV;
1281 } 1283 }
1282 } 1284 }
1285 memcpy(addr, prop_addr, sizeof(addr));
1283 1286
1284 dev = alloc_etherdev(PRIV_BYTES); 1287 dev = alloc_etherdev(PRIV_BYTES);
1285 if (!dev) { 1288 if (!dev) {
diff --git a/drivers/net/mace.c b/drivers/net/mace.c
index 29e4b5aa6ead..5d80e0e6a8e9 100644
--- a/drivers/net/mace.c
+++ b/drivers/net/mace.c
@@ -113,7 +113,7 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i
113 struct device_node *mace = macio_get_of_node(mdev); 113 struct device_node *mace = macio_get_of_node(mdev);
114 struct net_device *dev; 114 struct net_device *dev;
115 struct mace_data *mp; 115 struct mace_data *mp;
116 unsigned char *addr; 116 const unsigned char *addr;
117 int j, rev, rc = -EBUSY; 117 int j, rev, rc = -EBUSY;
118 118
119 if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) { 119 if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) {
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index fb1d5a8a45cf..b30290d53f79 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -1812,10 +1812,10 @@ spider_net_setup_phy(struct spider_net_card *card)
1812 */ 1812 */
1813static int 1813static int
1814spider_net_download_firmware(struct spider_net_card *card, 1814spider_net_download_firmware(struct spider_net_card *card,
1815 u8 *firmware_ptr) 1815 const void *firmware_ptr)
1816{ 1816{
1817 int sequencer, i; 1817 int sequencer, i;
1818 u32 *fw_ptr = (u32 *)firmware_ptr; 1818 const u32 *fw_ptr = firmware_ptr;
1819 1819
1820 /* stop sequencers */ 1820 /* stop sequencers */
1821 spider_net_write_reg(card, SPIDER_NET_GSINIT, 1821 spider_net_write_reg(card, SPIDER_NET_GSINIT,
@@ -1872,7 +1872,7 @@ spider_net_init_firmware(struct spider_net_card *card)
1872{ 1872{
1873 struct firmware *firmware = NULL; 1873 struct firmware *firmware = NULL;
1874 struct device_node *dn; 1874 struct device_node *dn;
1875 u8 *fw_prop = NULL; 1875 const u8 *fw_prop = NULL;
1876 int err = -ENOENT; 1876 int err = -ENOENT;
1877 int fw_size; 1877 int fw_size;
1878 1878
@@ -1898,7 +1898,7 @@ try_host_fw:
1898 if (!dn) 1898 if (!dn)
1899 goto out_err; 1899 goto out_err;
1900 1900
1901 fw_prop = (u8 *)get_property(dn, "firmware", &fw_size); 1901 fw_prop = get_property(dn, "firmware", &fw_size);
1902 if (!fw_prop) 1902 if (!fw_prop)
1903 goto out_err; 1903 goto out_err;
1904 1904
@@ -2058,7 +2058,7 @@ spider_net_setup_netdev(struct spider_net_card *card)
2058 struct net_device *netdev = card->netdev; 2058 struct net_device *netdev = card->netdev;
2059 struct device_node *dn; 2059 struct device_node *dn;
2060 struct sockaddr addr; 2060 struct sockaddr addr;
2061 u8 *mac; 2061 const u8 *mac;
2062 2062
2063 SET_MODULE_OWNER(netdev); 2063 SET_MODULE_OWNER(netdev);
2064 SET_NETDEV_DEV(netdev, &card->pdev->dev); 2064 SET_NETDEV_DEV(netdev, &card->pdev->dev);
@@ -2089,7 +2089,7 @@ spider_net_setup_netdev(struct spider_net_card *card)
2089 if (!dn) 2089 if (!dn)
2090 return -EIO; 2090 return -EIO;
2091 2091
2092 mac = (u8 *)get_property(dn, "local-mac-address", NULL); 2092 mac = get_property(dn, "local-mac-address", NULL);
2093 if (!mac) 2093 if (!mac)
2094 return -EIO; 2094 return -EIO;
2095 memcpy(addr.sa_data, mac, ETH_ALEN); 2095 memcpy(addr.sa_data, mac, ETH_ALEN);
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index b70bbd748978..d7b1d1882cab 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -2896,7 +2896,7 @@ static int __devinit gem_get_device_address(struct gem *gp)
2896 if (use_idprom) 2896 if (use_idprom)
2897 memcpy(dev->dev_addr, idprom->id_ethaddr, 6); 2897 memcpy(dev->dev_addr, idprom->id_ethaddr, 6);
2898#elif defined(CONFIG_PPC_PMAC) 2898#elif defined(CONFIG_PPC_PMAC)
2899 unsigned char *addr; 2899 const unsigned char *addr;
2900 2900
2901 addr = get_property(gp->of_node, "local-mac-address", NULL); 2901 addr = get_property(gp->of_node, "local-mac-address", NULL);
2902 if (addr == NULL) { 2902 if (addr == NULL) {