Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332220
b: refs/heads/master
c: f321238
h: refs/heads/master
v: v3
  • Loading branch information
David Daney committed Aug 31, 2012
1 parent b94e582 commit a2a0576
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 052958e347a0219313730ee7c437edfab0611ec1
refs/heads/master: f321238b17040ce9ba671d5aff7ad540c6c6ace4
16 changes: 9 additions & 7 deletions trunk/drivers/net/ethernet/octeon/octeon_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,12 +648,10 @@ static void octeon_mgmt_set_rx_filtering(struct net_device *netdev)

static int octeon_mgmt_set_mac_address(struct net_device *netdev, void *addr)
{
struct sockaddr *sa = addr;
int r = eth_mac_addr(netdev, addr);

if (!is_valid_ether_addr(sa->sa_data))
return -EADDRNOTAVAIL;

memcpy(netdev->dev_addr, sa->sa_data, ETH_ALEN);
if (r)
return r;

octeon_mgmt_set_rx_filtering(netdev);

Expand Down Expand Up @@ -1545,8 +1543,12 @@ static int __devinit octeon_mgmt_probe(struct platform_device *pdev)

mac = of_get_mac_address(pdev->dev.of_node);

if (mac)
memcpy(netdev->dev_addr, mac, 6);
if (mac && is_valid_ether_addr(mac)) {
memcpy(netdev->dev_addr, mac, ETH_ALEN);
netdev->addr_assign_type &= ~NET_ADDR_RANDOM;
} else {
eth_hw_addr_random(netdev);
}

p->phy_np = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0);

Expand Down

0 comments on commit a2a0576

Please sign in to comment.