提交 ba94272d 编写于 作者: S Sowmini Varadhan 提交者: Jeff Kirsher

i40e: use eth_platform_get_mac_address()

This commit converts commit b499ffb0 ("i40e: Look up MAC address in
Open Firmware or IDPROM") to use eth_platform_get_mac_address()
added by commit c7f5d105 ("net: Add eth_platform_get_mac_address()
helper.")
Signed-off-by: NSowmini Varadhan <sowmini.varadhan@oracle.com>
Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 72b74869
...@@ -28,11 +28,6 @@ ...@@ -28,11 +28,6 @@
#include <linux/of_net.h> #include <linux/of_net.h>
#include <linux/pci.h> #include <linux/pci.h>
#ifdef CONFIG_SPARC
#include <asm/idprom.h>
#include <asm/prom.h>
#endif
/* Local includes */ /* Local includes */
#include "i40e.h" #include "i40e.h"
#include "i40e_diag.h" #include "i40e_diag.h"
...@@ -10618,21 +10613,9 @@ static void i40e_print_features(struct i40e_pf *pf) ...@@ -10618,21 +10613,9 @@ static void i40e_print_features(struct i40e_pf *pf)
**/ **/
static void i40e_get_platform_mac_addr(struct pci_dev *pdev, struct i40e_pf *pf) static void i40e_get_platform_mac_addr(struct pci_dev *pdev, struct i40e_pf *pf)
{ {
struct device_node *dp = pci_device_to_OF_node(pdev);
const unsigned char *addr;
u8 *mac_addr = pf->hw.mac.addr;
pf->flags &= ~I40E_FLAG_PF_MAC; pf->flags &= ~I40E_FLAG_PF_MAC;
addr = of_get_mac_address(dp); if (!eth_platform_get_mac_address(&pdev->dev, pf->hw.mac.addr))
if (addr) {
ether_addr_copy(mac_addr, addr);
pf->flags |= I40E_FLAG_PF_MAC; pf->flags |= I40E_FLAG_PF_MAC;
#ifdef CONFIG_SPARC
} else {
ether_addr_copy(mac_addr, idprom->id_ethaddr);
pf->flags |= I40E_FLAG_PF_MAC;
#endif /* CONFIG_SPARC */
}
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册