Skip to content

Commit

Permalink
ixgbe: use eth_platform_get_mac_address()
Browse files Browse the repository at this point in the history
This commit converts commit c762dff ("ixgbe: Look up MAC address in
Open Firmware or IDPROM") to use eth_platform_get_mac_address()
added by commit c7f5d10 ("net: Add eth_platform_get_mac_address()
helper.")

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Sowmini Varadhan authored and Jeff Kirsher committed Apr 4, 2016
1 parent 3768901 commit c7374b5
Showing 1 changed file with 2 additions and 33 deletions.
35 changes: 2 additions & 33 deletions drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@
#include <net/pkt_cls.h>
#include <net/tc_act/tc_gact.h>

#ifdef CONFIG_OF
#include <linux/of_net.h>
#endif

#ifdef CONFIG_SPARC
#include <asm/idprom.h>
#include <asm/prom.h>
#endif

#include "ixgbe.h"
#include "ixgbe_common.h"
#include "ixgbe_dcb_82599.h"
Expand Down Expand Up @@ -9010,29 +9001,6 @@ int ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id,
return is_wol_supported;
}

/**
* ixgbe_get_platform_mac_addr - Look up MAC address in Open Firmware / IDPROM
* @adapter: Pointer to adapter struct
*/
static void ixgbe_get_platform_mac_addr(struct ixgbe_adapter *adapter)
{
#ifdef CONFIG_OF
struct device_node *dp = pci_device_to_OF_node(adapter->pdev);
struct ixgbe_hw *hw = &adapter->hw;
const unsigned char *addr;

addr = of_get_mac_address(dp);
if (addr) {
ether_addr_copy(hw->mac.perm_addr, addr);
return;
}
#endif /* CONFIG_OF */

#ifdef CONFIG_SPARC
ether_addr_copy(hw->mac.perm_addr, idprom->id_ethaddr);
#endif /* CONFIG_SPARC */
}

/**
* ixgbe_probe - Device Initialization Routine
* @pdev: PCI device information struct
Expand Down Expand Up @@ -9304,7 +9272,8 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_sw_init;
}

ixgbe_get_platform_mac_addr(adapter);
eth_platform_get_mac_address(&adapter->pdev->dev,
adapter->hw.mac.perm_addr);

memcpy(netdev->dev_addr, hw->mac.perm_addr, netdev->addr_len);

Expand Down

0 comments on commit c7374b5

Please sign in to comment.