Skip to content

Commit 3ec3ebe

Browse files
committed
Merge branch 'rswitch-fixes'
Yoshihiro Shimoda says: ==================== net: ethernet: renesas: rswitch: Fix minor issues This patch series is based on v6.2-rc2. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 8185201 + bd2adfe commit 3ec3ebe

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/net/ethernet/renesas/rswitch.c

Lines changed: 9 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);
@@ -1786,6 +1789,11 @@ static int renesas_eth_sw_probe(struct platform_device *pdev)
17861789
pm_runtime_get_sync(&pdev->dev);
17871790

17881791
ret = rswitch_init(priv);
1792+
if (ret < 0) {
1793+
pm_runtime_put(&pdev->dev);
1794+
pm_runtime_disable(&pdev->dev);
1795+
return ret;
1796+
}
17891797

17901798
device_set_wakeup_capable(&pdev->dev, 1);
17911799

0 commit comments

Comments
 (0)