Skip to content

Commit c7374b5

Browse files
sowminivJeff Kirsher
authored andcommitted
ixgbe: use eth_platform_get_mac_address()
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 <[email protected]> Tested-by: Phil Schmitt <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 3768901 commit c7374b5

File tree

1 file changed

+2
-33
lines changed

1 file changed

+2
-33
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,6 @@
5454
#include <net/pkt_cls.h>
5555
#include <net/tc_act/tc_gact.h>
5656

57-
#ifdef CONFIG_OF
58-
#include <linux/of_net.h>
59-
#endif
60-
61-
#ifdef CONFIG_SPARC
62-
#include <asm/idprom.h>
63-
#include <asm/prom.h>
64-
#endif
65-
6657
#include "ixgbe.h"
6758
#include "ixgbe_common.h"
6859
#include "ixgbe_dcb_82599.h"
@@ -9010,29 +9001,6 @@ int ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id,
90109001
return is_wol_supported;
90119002
}
90129003

9013-
/**
9014-
* ixgbe_get_platform_mac_addr - Look up MAC address in Open Firmware / IDPROM
9015-
* @adapter: Pointer to adapter struct
9016-
*/
9017-
static void ixgbe_get_platform_mac_addr(struct ixgbe_adapter *adapter)
9018-
{
9019-
#ifdef CONFIG_OF
9020-
struct device_node *dp = pci_device_to_OF_node(adapter->pdev);
9021-
struct ixgbe_hw *hw = &adapter->hw;
9022-
const unsigned char *addr;
9023-
9024-
addr = of_get_mac_address(dp);
9025-
if (addr) {
9026-
ether_addr_copy(hw->mac.perm_addr, addr);
9027-
return;
9028-
}
9029-
#endif /* CONFIG_OF */
9030-
9031-
#ifdef CONFIG_SPARC
9032-
ether_addr_copy(hw->mac.perm_addr, idprom->id_ethaddr);
9033-
#endif /* CONFIG_SPARC */
9034-
}
9035-
90369004
/**
90379005
* ixgbe_probe - Device Initialization Routine
90389006
* @pdev: PCI device information struct
@@ -9304,7 +9272,8 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
93049272
goto err_sw_init;
93059273
}
93069274

9307-
ixgbe_get_platform_mac_addr(adapter);
9275+
eth_platform_get_mac_address(&adapter->pdev->dev,
9276+
adapter->hw.mac.perm_addr);
93089277

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

0 commit comments

Comments
 (0)