Skip to content

Commit

Permalink
net-next: ethernet: mediatek: add device_node of GMAC pointing into t…
Browse files Browse the repository at this point in the history
…he netdev instance

the patch adds the setup of the corresponding device node of GMAC into the
netdev instance which could allow other modules such as DSA to find the
instance through the node in dt-bindings using of_find_net_device_by_node()
call.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sean Wang authored and David S. Miller committed Apr 7, 2017
1 parent 87e3df4 commit 3174b3b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/mediatek/mtk_eth_soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2322,6 +2322,8 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
eth->netdev[id]->ethtool_ops = &mtk_ethtool_ops;

eth->netdev[id]->irq = eth->irq[0];
eth->netdev[id]->dev.of_node = np;

return 0;

free_netdev:
Expand Down

0 comments on commit 3174b3b

Please sign in to comment.