[PATCH net 0/2] net: ethernet: renesas: rswitch: Fix minor issues

STALE1317d

4 messages, 2 authors, 2022-12-28 · open the first message on its own page

[PATCH net 0/2] net: ethernet: renesas: rswitch: Fix minor issues

From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: 2022-12-26 07:13:36

This patch series is based on v6.2-rc2.

Yoshihiro Shimoda (2):
  net: ethernet: renesas: rswitch: Fix error path in
    renesas_eth_sw_probe()
  net: ethernet: renesas: rswitch: Fix getting mac address from device
    tree

 drivers/net/ethernet/renesas/rswitch.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

-- 
2.25.1

[PATCH net 2/2] net: ethernet: renesas: rswitch: Fix getting mac address from device tree

From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: 2022-12-26 07:13:36

To get mac address from device tree which is from each ethernet-port,
fix the first argument of of_get_ethdev_address().

Fixes: 3590918b5d07 ("net: ethernet: renesas: Add support for "Ethernet Switch"")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/net/ethernet/renesas/rswitch.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/renesas/rswitch.c b/drivers/net/ethernet/renesas/rswitch.c
index 473d86bdf97d..6441892636db 100644
--- a/drivers/net/ethernet/renesas/rswitch.c
+++ b/drivers/net/ethernet/renesas/rswitch.c
@@ -1578,6 +1578,7 @@ static int rswitch_device_alloc(struct rswitch_private *priv, int index)
 {
 	struct platform_device *pdev = priv->pdev;
 	struct rswitch_device *rdev;
+	struct device_node *port;
 	struct net_device *ndev;
 	int err;
 
@@ -1606,7 +1607,9 @@ static int rswitch_device_alloc(struct rswitch_private *priv, int index)
 
 	netif_napi_add(ndev, &rdev->napi, rswitch_poll);
 
-	err = of_get_ethdev_address(pdev->dev.of_node, ndev);
+	port = rswitch_get_port_node(rdev);
+	err = of_get_ethdev_address(port, ndev);
+	of_node_put(port);
 	if (err) {
 		if (is_valid_ether_addr(rdev->etha->mac_addr))
 			eth_hw_addr_set(ndev, rdev->etha->mac_addr);
-- 
2.25.1

[PATCH net 1/2] net: ethernet: renesas: rswitch: Fix error path in renesas_eth_sw_probe()

From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: 2022-12-26 07:13:37

If rswitch_init() returns non-zero and this driver is re-probed,
the following error happens:

    renesas_eth_sw e6880000.ethernet: Unbalanced pm_runtime_enable!

So, fix error path in renesas_eth_sw_probe().

Fixes: 3590918b5d07 ("net: ethernet: renesas: Add support for "Ethernet Switch"")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/net/ethernet/renesas/rswitch.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/renesas/rswitch.c b/drivers/net/ethernet/renesas/rswitch.c
index e42ceaa0099f..473d86bdf97d 100644
--- a/drivers/net/ethernet/renesas/rswitch.c
+++ b/drivers/net/ethernet/renesas/rswitch.c
@@ -1786,6 +1786,11 @@ static int renesas_eth_sw_probe(struct platform_device *pdev)
 	pm_runtime_get_sync(&pdev->dev);
 
 	ret = rswitch_init(priv);
+	if (ret < 0) {
+		pm_runtime_put(&pdev->dev);
+		pm_runtime_disable(&pdev->dev);
+		return ret;
+	}
 
 	device_set_wakeup_capable(&pdev->dev, 1);
 
-- 
2.25.1

Re: [PATCH net 0/2] net: ethernet: renesas: rswitch: Fix minor issues

From: patchwork-bot+netdevbpf@kernel.org
Date: 2022-12-28 10:20:23

Hello:

This series was applied to netdev/net.git (master)
by David S. Miller [off-list ref]:

On Mon, 26 Dec 2022 16:13:26 +0900 you wrote:
This patch series is based on v6.2-rc2.

Yoshihiro Shimoda (2):
  net: ethernet: renesas: rswitch: Fix error path in
    renesas_eth_sw_probe()
  net: ethernet: renesas: rswitch: Fix getting mac address from device
    tree

[...]
Here is the summary with links:
  - [net,1/2] net: ethernet: renesas: rswitch: Fix error path in renesas_eth_sw_probe()
    https://git.kernel.org/netdev/net/c/8e6a8d7a3dd9
  - [net,2/2] net: ethernet: renesas: rswitch: Fix getting mac address from device tree
    https://git.kernel.org/netdev/net/c/bd2adfe3b3b8

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help