mirror of https://gitee.com/openkylin/linux.git
net: qcom/emac: use device_get_mac_address
Replace the DT-specific of_get_mac_address() function with device_get_mac_address, which works on both DT and ACPI platforms. This change makes it easier to add ACPI support. Signed-off-by: Timur Tabi <timur@codeaurora.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
54e19bc74f
commit
0de709acbc
|
@ -531,18 +531,16 @@ static void emac_clks_teardown(struct emac_adapter *adpt)
|
||||||
static int emac_probe_resources(struct platform_device *pdev,
|
static int emac_probe_resources(struct platform_device *pdev,
|
||||||
struct emac_adapter *adpt)
|
struct emac_adapter *adpt)
|
||||||
{
|
{
|
||||||
struct device_node *node = pdev->dev.of_node;
|
|
||||||
struct net_device *netdev = adpt->netdev;
|
struct net_device *netdev = adpt->netdev;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
const void *maddr;
|
char maddr[ETH_ALEN];
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
/* get mac address */
|
/* get mac address */
|
||||||
maddr = of_get_mac_address(node);
|
if (device_get_mac_address(&pdev->dev, maddr, ETH_ALEN))
|
||||||
if (!maddr)
|
|
||||||
eth_hw_addr_random(netdev);
|
|
||||||
else
|
|
||||||
ether_addr_copy(netdev->dev_addr, maddr);
|
ether_addr_copy(netdev->dev_addr, maddr);
|
||||||
|
else
|
||||||
|
eth_hw_addr_random(netdev);
|
||||||
|
|
||||||
/* Core 0 interrupt */
|
/* Core 0 interrupt */
|
||||||
ret = platform_get_irq(pdev, 0);
|
ret = platform_get_irq(pdev, 0);
|
||||||
|
|
Loading…
Reference in New Issue