rename dev_hw_addr_random and remove redundant second
Renamed dev_hw_addr_random to eth_hw_addr_random() to reflect that this function only assign a random ethernet address (MAC). Removed the second parameter (u8 *hwaddr), it's redundant since the also given net_device already contains net_device->dev_addr. Set it directly. Adapt igbvf and ixgbevf to the changed function. Small fix for ixgbevf_probe(): if ixgbevf_sw_init() fails (which means the device got no dev_addr) handle the error and jump to err_sw_init as already done by igbvf in similar case. Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
c8585bd89e
commit
1a0d6ae579
@@ -2712,18 +2712,19 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
|
||||
dev_info(&pdev->dev,
|
||||
"PF still in reset state, assigning new address."
|
||||
" Is the PF interface up?\n");
|
||||
dev_hw_addr_random(adapter->netdev, hw->mac.addr);
|
||||
eth_hw_addr_random(netdev);
|
||||
memcpy(adapter->hw.mac.addr, netdev->dev_addr,
|
||||
netdev->addr_len);
|
||||
} else {
|
||||
err = hw->mac.ops.read_mac_addr(hw);
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "Error reading MAC address\n");
|
||||
goto err_hw_init;
|
||||
}
|
||||
memcpy(netdev->dev_addr, adapter->hw.mac.addr,
|
||||
netdev->addr_len);
|
||||
}
|
||||
|
||||
memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len);
|
||||
memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);
|
||||
|
||||
if (!is_valid_ether_addr(netdev->perm_addr)) {
|
||||
dev_err(&pdev->dev, "Invalid MAC Address: %pM\n",
|
||||
netdev->dev_addr);
|
||||
@@ -2731,6 +2732,8 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
|
||||
goto err_hw_init;
|
||||
}
|
||||
|
||||
memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);
|
||||
|
||||
setup_timer(&adapter->watchdog_timer, &igbvf_watchdog,
|
||||
(unsigned long) adapter);
|
||||
|
||||
|
Reference in New Issue
Block a user