]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
mv643xx_eth: move mac_addr inside mv643xx_eth_platform_data
authorDale Farnsworth <dale@farnsworth.org>
Thu, 1 Mar 2007 23:31:48 +0000 (16:31 -0700)
committerJeff Garzik <jeff@garzik.org>
Sat, 3 Mar 2007 01:16:10 +0000 (20:16 -0500)
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>
arch/mips/momentum/jaguar_atx/platform.c
arch/mips/momentum/ocelot_3/platform.c
arch/mips/momentum/ocelot_c/platform.c
drivers/net/mv643xx_eth.c
include/linux/mv643xx.h

index 3df36eda75af6228445a64d28c2c4ee12a98d89e..771e55f398755d7b7ae9c2861c156f0f823c2af4 100644 (file)
@@ -47,11 +47,7 @@ static struct resource mv64x60_eth0_resources[] = {
        },
 };
 
-static char eth0_mac_addr[ETH_ALEN];
-
 static struct mv643xx_eth_platform_data eth0_pd = {
-       .mac_addr       = eth0_mac_addr,
-
        .tx_sram_addr   = MV_SRAM_BASE_ETH0,
        .tx_sram_size   = MV_SRAM_TXRING_SIZE,
        .tx_queue_size  = MV_SRAM_TXRING_SIZE / 16,
@@ -80,11 +76,7 @@ static struct resource mv64x60_eth1_resources[] = {
        },
 };
 
-static char eth1_mac_addr[ETH_ALEN];
-
 static struct mv643xx_eth_platform_data eth1_pd = {
-       .mac_addr       = eth1_mac_addr,
-
        .tx_sram_addr   = MV_SRAM_BASE_ETH1,
        .tx_sram_size   = MV_SRAM_TXRING_SIZE,
        .tx_queue_size  = MV_SRAM_TXRING_SIZE / 16,
@@ -113,11 +105,7 @@ static struct resource mv64x60_eth2_resources[] = {
        },
 };
 
-static char eth2_mac_addr[ETH_ALEN];
-
-static struct mv643xx_eth_platform_data eth2_pd = {
-       .mac_addr       = eth2_mac_addr,
-};
+static struct mv643xx_eth_platform_data eth2_pd;
 
 static struct platform_device eth2_device = {
        .name           = MV643XX_ETH_NAME,
@@ -200,9 +188,9 @@ static int __init mv643xx_eth_add_pds(void)
        int ret;
 
        get_mac(mac);
-       eth_mac_add(eth0_mac_addr, mac, 0);
-       eth_mac_add(eth1_mac_addr, mac, 1);
-       eth_mac_add(eth2_mac_addr, mac, 2);
+       eth_mac_add(eth0_pd.mac_addr, mac, 0);
+       eth_mac_add(eth1_pd.mac_addr, mac, 1);
+       eth_mac_add(eth2_pd.mac_addr, mac, 2);
        ret = platform_add_devices(mv643xx_eth_pd_devs,
                        ARRAY_SIZE(mv643xx_eth_pd_devs));
 
index 024aef25f3728bba2d8a988141778ca75a8c391d..b80733f0c66ddca1b33b137e83c8c7167caca812 100644 (file)
@@ -47,11 +47,7 @@ static struct resource mv64x60_eth0_resources[] = {
        },
 };
 
-static char eth0_mac_addr[ETH_ALEN];
-
 static struct mv643xx_eth_platform_data eth0_pd = {
-       .mac_addr       = eth0_mac_addr,
-
        .tx_sram_addr   = MV_SRAM_BASE_ETH0,
        .tx_sram_size   = MV_SRAM_TXRING_SIZE,
        .tx_queue_size  = MV_SRAM_TXRING_SIZE / 16,
@@ -80,11 +76,7 @@ static struct resource mv64x60_eth1_resources[] = {
        },
 };
 
-static char eth1_mac_addr[ETH_ALEN];
-
 static struct mv643xx_eth_platform_data eth1_pd = {
-       .mac_addr       = eth1_mac_addr,
-
        .tx_sram_addr   = MV_SRAM_BASE_ETH1,
        .tx_sram_size   = MV_SRAM_TXRING_SIZE,
        .tx_queue_size  = MV_SRAM_TXRING_SIZE / 16,
@@ -113,11 +105,7 @@ static struct resource mv64x60_eth2_resources[] = {
        },
 };
 
-static char eth2_mac_addr[ETH_ALEN];
-
-static struct mv643xx_eth_platform_data eth2_pd = {
-       .mac_addr       = eth2_mac_addr,
-};
+static struct mv643xx_eth_platform_data eth2_pd;
 
 static struct platform_device eth2_device = {
        .name           = MV643XX_ETH_NAME,
@@ -200,9 +188,9 @@ static int __init mv643xx_eth_add_pds(void)
        int ret;
 
        get_mac(mac);
-       eth_mac_add(eth0_mac_addr, mac, 0);
-       eth_mac_add(eth1_mac_addr, mac, 1);
-       eth_mac_add(eth2_mac_addr, mac, 2);
+       eth_mac_add(eth0_pd.mac_addr, mac, 0);
+       eth_mac_add(eth1_pd.mac_addr, mac, 1);
+       eth_mac_add(eth2_pd.mac_addr, mac, 2);
        ret = platform_add_devices(mv643xx_eth_pd_devs,
                        ARRAY_SIZE(mv643xx_eth_pd_devs));
 
index fac8b2499387a7c83137d4d75747b7f6c96a5dcb..f7cd303f3eba62a10e81d1a7ea0639fd6c444275 100644 (file)
@@ -46,11 +46,7 @@ static struct resource mv64x60_eth0_resources[] = {
        },
 };
 
-static char eth0_mac_addr[ETH_ALEN];
-
 static struct mv643xx_eth_platform_data eth0_pd = {
-       .mac_addr       = eth0_mac_addr,
-
        .tx_sram_addr   = MV_SRAM_BASE_ETH0,
        .tx_sram_size   = MV_SRAM_TXRING_SIZE,
        .tx_queue_size  = MV_SRAM_TXRING_SIZE / 16,
@@ -79,11 +75,7 @@ static struct resource mv64x60_eth1_resources[] = {
        },
 };
 
-static char eth1_mac_addr[ETH_ALEN];
-
 static struct mv643xx_eth_platform_data eth1_pd = {
-       .mac_addr       = eth1_mac_addr,
-
        .tx_sram_addr   = MV_SRAM_BASE_ETH1,
        .tx_sram_size   = MV_SRAM_TXRING_SIZE,
        .tx_queue_size  = MV_SRAM_TXRING_SIZE / 16,
@@ -174,8 +166,8 @@ static int __init mv643xx_eth_add_pds(void)
        int ret;
 
        get_mac(mac);
-       eth_mac_add(eth0_mac_addr, mac, 0);
-       eth_mac_add(eth1_mac_addr, mac, 1);
+       eth_mac_add(eth0_pd.mac_addr, mac, 0);
+       eth_mac_add(eth1_pd.mac_addr, mac, 1);
        ret = platform_add_devices(mv643xx_eth_pd_devs,
                        ARRAY_SIZE(mv643xx_eth_pd_devs));
 
index 3e045a695dbc209cc99fa72b55f4365bad24d586..be2ddbb6ef56d8ed4dd32753a1d83816f0fa3590 100644 (file)
@@ -1380,7 +1380,7 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 
        pd = pdev->dev.platform_data;
        if (pd) {
-               if (pd->mac_addr)
+               if (is_valid_ether_addr(pd->mac_addr))
                        memcpy(dev->dev_addr, pd->mac_addr, 6);
 
                if (pd->phy_addr || pd->force_phy_addr)
index aff25c000abfba988e6a3922192a97b15ea2adf0..e7d4da1cc9fa3235d99ba3ce8a07ecfbdfbe7eef 100644 (file)
@@ -1288,7 +1288,6 @@ struct mv64xxx_i2c_pdata {
 #define MV643XX_ETH_NAME       "mv643xx_eth"
 
 struct mv643xx_eth_platform_data {
-       char            *mac_addr;      /* pointer to mac address */
        u16             force_phy_addr; /* force override if phy_addr == 0 */
        u16             phy_addr;
 
@@ -1303,6 +1302,7 @@ struct mv643xx_eth_platform_data {
        u32             tx_sram_size;
        u32             rx_sram_addr;
        u32             rx_sram_size;
+       u8              mac_addr[6];    /* mac address if non-zero*/
 };
 
 #endif /* __ASM_MV643XX_H */