aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom
diff options
context:
space:
mode:
authorDanny Kukawka <danny.kukawka@bisect.de>2012-02-20 21:07:49 -0500
committerDavid S. Miller <davem@davemloft.net>2012-02-23 17:03:20 -0500
commit504f9b5a6bb5336ad434438d0cdd61a16db80129 (patch)
tree307356c1d47a8300fd4973159edaad130c5cda9f /drivers/net/ethernet/broadcom
parent32d219ed61a97f6591a941e23673b2c1dd8628e7 (diff)
ethernet: unify return value of .ndo_set_mac_address if address is invalid
Unify return value of .ndo_set_mac_address if the given address isn't valid. Return -EADDRNOTAVAIL as eth_mac_addr() already does if is_valid_ether_addr() fails. Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2.c2
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
index 7105989ba658..8297e2868736 100644
--- a/drivers/net/ethernet/broadcom/bnx2.c
+++ b/drivers/net/ethernet/broadcom/bnx2.c
@@ -7773,7 +7773,7 @@ bnx2_change_mac_addr(struct net_device *dev, void *p)
7773 struct bnx2 *bp = netdev_priv(dev); 7773 struct bnx2 *bp = netdev_priv(dev);
7774 7774
7775 if (!is_valid_ether_addr(addr->sa_data)) 7775 if (!is_valid_ether_addr(addr->sa_data))
7776 return -EINVAL; 7776 return -EADDRNOTAVAIL;
7777 7777
7778 memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); 7778 memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
7779 if (netif_running(dev)) 7779 if (netif_running(dev))
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index ec5bc3d04333..97dcccdb9eb2 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -8045,7 +8045,7 @@ static int tg3_set_mac_addr(struct net_device *dev, void *p)
8045 int err = 0, skip_mac_1 = 0; 8045 int err = 0, skip_mac_1 = 0;
8046 8046
8047 if (!is_valid_ether_addr(addr->sa_data)) 8047 if (!is_valid_ether_addr(addr->sa_data))
8048 return -EINVAL; 8048 return -EADDRNOTAVAIL;
8049 8049
8050 memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); 8050 memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
8051 8051