mv643xx_eth: move mac_addr inside mv643xx_eth_platform_data

The information contained within platform_data should be self-contained.
Replace the pointer to a MAC address with the actual MAC address in
struct mv643xx_eth_platform_data.

Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by Dale Farnsworth and committed by Jeff Garzik 5ada386b 471a5671

+12 -44
+4 -16
arch/mips/momentum/jaguar_atx/platform.c
··· 47 }, 48 }; 49 50 - static char eth0_mac_addr[ETH_ALEN]; 51 - 52 static struct mv643xx_eth_platform_data eth0_pd = { 53 - .mac_addr = eth0_mac_addr, 54 - 55 .tx_sram_addr = MV_SRAM_BASE_ETH0, 56 .tx_sram_size = MV_SRAM_TXRING_SIZE, 57 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, ··· 76 }, 77 }; 78 79 - static char eth1_mac_addr[ETH_ALEN]; 80 - 81 static struct mv643xx_eth_platform_data eth1_pd = { 82 - .mac_addr = eth1_mac_addr, 83 - 84 .tx_sram_addr = MV_SRAM_BASE_ETH1, 85 .tx_sram_size = MV_SRAM_TXRING_SIZE, 86 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, ··· 105 }, 106 }; 107 108 - static char eth2_mac_addr[ETH_ALEN]; 109 - 110 - static struct mv643xx_eth_platform_data eth2_pd = { 111 - .mac_addr = eth2_mac_addr, 112 - }; 113 114 static struct platform_device eth2_device = { 115 .name = MV643XX_ETH_NAME, ··· 188 int ret; 189 190 get_mac(mac); 191 - eth_mac_add(eth0_mac_addr, mac, 0); 192 - eth_mac_add(eth1_mac_addr, mac, 1); 193 - eth_mac_add(eth2_mac_addr, mac, 2); 194 ret = platform_add_devices(mv643xx_eth_pd_devs, 195 ARRAY_SIZE(mv643xx_eth_pd_devs)); 196
··· 47 }, 48 }; 49 50 static struct mv643xx_eth_platform_data eth0_pd = { 51 .tx_sram_addr = MV_SRAM_BASE_ETH0, 52 .tx_sram_size = MV_SRAM_TXRING_SIZE, 53 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, ··· 80 }, 81 }; 82 83 static struct mv643xx_eth_platform_data eth1_pd = { 84 .tx_sram_addr = MV_SRAM_BASE_ETH1, 85 .tx_sram_size = MV_SRAM_TXRING_SIZE, 86 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, ··· 113 }, 114 }; 115 116 + static struct mv643xx_eth_platform_data eth2_pd; 117 118 static struct platform_device eth2_device = { 119 .name = MV643XX_ETH_NAME, ··· 200 int ret; 201 202 get_mac(mac); 203 + eth_mac_add(eth0_pd.mac_addr, mac, 0); 204 + eth_mac_add(eth1_pd.mac_addr, mac, 1); 205 + eth_mac_add(eth2_pd.mac_addr, mac, 2); 206 ret = platform_add_devices(mv643xx_eth_pd_devs, 207 ARRAY_SIZE(mv643xx_eth_pd_devs)); 208
+4 -16
arch/mips/momentum/ocelot_3/platform.c
··· 47 }, 48 }; 49 50 - static char eth0_mac_addr[ETH_ALEN]; 51 - 52 static struct mv643xx_eth_platform_data eth0_pd = { 53 - .mac_addr = eth0_mac_addr, 54 - 55 .tx_sram_addr = MV_SRAM_BASE_ETH0, 56 .tx_sram_size = MV_SRAM_TXRING_SIZE, 57 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, ··· 76 }, 77 }; 78 79 - static char eth1_mac_addr[ETH_ALEN]; 80 - 81 static struct mv643xx_eth_platform_data eth1_pd = { 82 - .mac_addr = eth1_mac_addr, 83 - 84 .tx_sram_addr = MV_SRAM_BASE_ETH1, 85 .tx_sram_size = MV_SRAM_TXRING_SIZE, 86 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, ··· 105 }, 106 }; 107 108 - static char eth2_mac_addr[ETH_ALEN]; 109 - 110 - static struct mv643xx_eth_platform_data eth2_pd = { 111 - .mac_addr = eth2_mac_addr, 112 - }; 113 114 static struct platform_device eth2_device = { 115 .name = MV643XX_ETH_NAME, ··· 188 int ret; 189 190 get_mac(mac); 191 - eth_mac_add(eth0_mac_addr, mac, 0); 192 - eth_mac_add(eth1_mac_addr, mac, 1); 193 - eth_mac_add(eth2_mac_addr, mac, 2); 194 ret = platform_add_devices(mv643xx_eth_pd_devs, 195 ARRAY_SIZE(mv643xx_eth_pd_devs)); 196
··· 47 }, 48 }; 49 50 static struct mv643xx_eth_platform_data eth0_pd = { 51 .tx_sram_addr = MV_SRAM_BASE_ETH0, 52 .tx_sram_size = MV_SRAM_TXRING_SIZE, 53 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, ··· 80 }, 81 }; 82 83 static struct mv643xx_eth_platform_data eth1_pd = { 84 .tx_sram_addr = MV_SRAM_BASE_ETH1, 85 .tx_sram_size = MV_SRAM_TXRING_SIZE, 86 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, ··· 113 }, 114 }; 115 116 + static struct mv643xx_eth_platform_data eth2_pd; 117 118 static struct platform_device eth2_device = { 119 .name = MV643XX_ETH_NAME, ··· 200 int ret; 201 202 get_mac(mac); 203 + eth_mac_add(eth0_pd.mac_addr, mac, 0); 204 + eth_mac_add(eth1_pd.mac_addr, mac, 1); 205 + eth_mac_add(eth2_pd.mac_addr, mac, 2); 206 ret = platform_add_devices(mv643xx_eth_pd_devs, 207 ARRAY_SIZE(mv643xx_eth_pd_devs)); 208
+2 -10
arch/mips/momentum/ocelot_c/platform.c
··· 46 }, 47 }; 48 49 - static char eth0_mac_addr[ETH_ALEN]; 50 - 51 static struct mv643xx_eth_platform_data eth0_pd = { 52 - .mac_addr = eth0_mac_addr, 53 - 54 .tx_sram_addr = MV_SRAM_BASE_ETH0, 55 .tx_sram_size = MV_SRAM_TXRING_SIZE, 56 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, ··· 75 }, 76 }; 77 78 - static char eth1_mac_addr[ETH_ALEN]; 79 - 80 static struct mv643xx_eth_platform_data eth1_pd = { 81 - .mac_addr = eth1_mac_addr, 82 - 83 .tx_sram_addr = MV_SRAM_BASE_ETH1, 84 .tx_sram_size = MV_SRAM_TXRING_SIZE, 85 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, ··· 166 int ret; 167 168 get_mac(mac); 169 - eth_mac_add(eth0_mac_addr, mac, 0); 170 - eth_mac_add(eth1_mac_addr, mac, 1); 171 ret = platform_add_devices(mv643xx_eth_pd_devs, 172 ARRAY_SIZE(mv643xx_eth_pd_devs)); 173
··· 46 }, 47 }; 48 49 static struct mv643xx_eth_platform_data eth0_pd = { 50 .tx_sram_addr = MV_SRAM_BASE_ETH0, 51 .tx_sram_size = MV_SRAM_TXRING_SIZE, 52 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, ··· 79 }, 80 }; 81 82 static struct mv643xx_eth_platform_data eth1_pd = { 83 .tx_sram_addr = MV_SRAM_BASE_ETH1, 84 .tx_sram_size = MV_SRAM_TXRING_SIZE, 85 .tx_queue_size = MV_SRAM_TXRING_SIZE / 16, ··· 174 int ret; 175 176 get_mac(mac); 177 + eth_mac_add(eth0_pd.mac_addr, mac, 0); 178 + eth_mac_add(eth1_pd.mac_addr, mac, 1); 179 ret = platform_add_devices(mv643xx_eth_pd_devs, 180 ARRAY_SIZE(mv643xx_eth_pd_devs)); 181
+1 -1
drivers/net/mv643xx_eth.c
··· 1380 1381 pd = pdev->dev.platform_data; 1382 if (pd) { 1383 - if (pd->mac_addr) 1384 memcpy(dev->dev_addr, pd->mac_addr, 6); 1385 1386 if (pd->phy_addr || pd->force_phy_addr)
··· 1380 1381 pd = pdev->dev.platform_data; 1382 if (pd) { 1383 + if (is_valid_ether_addr(pd->mac_addr)) 1384 memcpy(dev->dev_addr, pd->mac_addr, 6); 1385 1386 if (pd->phy_addr || pd->force_phy_addr)
+1 -1
include/linux/mv643xx.h
··· 1288 #define MV643XX_ETH_NAME "mv643xx_eth" 1289 1290 struct mv643xx_eth_platform_data { 1291 - char *mac_addr; /* pointer to mac address */ 1292 u16 force_phy_addr; /* force override if phy_addr == 0 */ 1293 u16 phy_addr; 1294 ··· 1302 u32 tx_sram_size; 1303 u32 rx_sram_addr; 1304 u32 rx_sram_size; 1305 }; 1306 1307 #endif /* __ASM_MV643XX_H */
··· 1288 #define MV643XX_ETH_NAME "mv643xx_eth" 1289 1290 struct mv643xx_eth_platform_data { 1291 u16 force_phy_addr; /* force override if phy_addr == 0 */ 1292 u16 phy_addr; 1293 ··· 1303 u32 tx_sram_size; 1304 u32 rx_sram_addr; 1305 u32 rx_sram_size; 1306 + u8 mac_addr[6]; /* mac address if non-zero*/ 1307 }; 1308 1309 #endif /* __ASM_MV643XX_H */