Skip to content

Commit bd2adfe

Browse files
shimodaydavem330
authored andcommitted
net: ethernet: renesas: rswitch: Fix getting mac address from device tree
To get mac address from device tree which is from each ethernet-port, fix the first argument of of_get_ethdev_address(). Fixes: 3590918 ("net: ethernet: renesas: Add support for "Ethernet Switch"") Signed-off-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8e6a8d7 commit bd2adfe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/renesas/rswitch.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,7 @@ static int rswitch_device_alloc(struct rswitch_private *priv, int index)
15781578
{
15791579
struct platform_device *pdev = priv->pdev;
15801580
struct rswitch_device *rdev;
1581+
struct device_node *port;
15811582
struct net_device *ndev;
15821583
int err;
15831584

@@ -1606,7 +1607,9 @@ static int rswitch_device_alloc(struct rswitch_private *priv, int index)
16061607

16071608
netif_napi_add(ndev, &rdev->napi, rswitch_poll);
16081609

1609-
err = of_get_ethdev_address(pdev->dev.of_node, ndev);
1610+
port = rswitch_get_port_node(rdev);
1611+
err = of_get_ethdev_address(port, ndev);
1612+
of_node_put(port);
16101613
if (err) {
16111614
if (is_valid_ether_addr(rdev->etha->mac_addr))
16121615
eth_hw_addr_set(ndev, rdev->etha->mac_addr);

0 commit comments

Comments
 (0)