All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] stmmac: dwmac-loongson: fix invalid mdio_node
@ 2022-11-01  6:02 Liu Peibao
  2022-11-01 23:42 ` Andrew Lunn
  2022-11-03  3:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Liu Peibao @ 2022-11-01  6:02 UTC (permalink / raw)
  To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Jiaxun Yang
  Cc: chenhuacai, lvjianmin, zhuyinbo, liupeibao, netdev, linux-kernel

In current code "plat->mdio_node" is always NULL, the mdio
support is lost as there is no "mdio_bus_data". The original
driver could work as the "mdio" variable is never set to
false, which is described in commit <b0e03950dd71> ("stmmac:
dwmac-loongson: fix uninitialized variable ......"). And
after this commit merged, the "mdio" variable is always
false, causing the mdio supoort logic lost.

Fixes: 30bba69d7db4 ("stmmac: pci: Add dwmac support for Loongson")
Signed-off-by: Liu Peibao <liupeibao@loongson.cn>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
index 017dbbda0c1c..79fa7870563b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
@@ -51,7 +51,6 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
 	struct stmmac_resources res;
 	struct device_node *np;
 	int ret, i, phy_mode;
-	bool mdio = false;
 
 	np = dev_of_node(&pdev->dev);
 
@@ -69,12 +68,10 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
 	if (!plat)
 		return -ENOMEM;
 
+	plat->mdio_node = of_get_child_by_name(np, "mdio");
 	if (plat->mdio_node) {
-		dev_err(&pdev->dev, "Found MDIO subnode\n");
-		mdio = true;
-	}
+		dev_info(&pdev->dev, "Found MDIO subnode\n");
 
-	if (mdio) {
 		plat->mdio_bus_data = devm_kzalloc(&pdev->dev,
 						   sizeof(*plat->mdio_bus_data),
 						   GFP_KERNEL);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] stmmac: dwmac-loongson: fix invalid mdio_node
  2022-11-01  6:02 [PATCH] stmmac: dwmac-loongson: fix invalid mdio_node Liu Peibao
@ 2022-11-01 23:42 ` Andrew Lunn
  2022-11-03  3:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2022-11-01 23:42 UTC (permalink / raw)
  To: Liu Peibao
  Cc: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Jiaxun Yang, chenhuacai, lvjianmin, zhuyinbo, netdev,
	linux-kernel

On Tue, Nov 01, 2022 at 02:02:18PM +0800, Liu Peibao wrote:
> In current code "plat->mdio_node" is always NULL, the mdio
> support is lost as there is no "mdio_bus_data". The original
> driver could work as the "mdio" variable is never set to
> false, which is described in commit <b0e03950dd71> ("stmmac:
> dwmac-loongson: fix uninitialized variable ......"). And
> after this commit merged, the "mdio" variable is always
> false, causing the mdio supoort logic lost.
> 
> Fixes: 30bba69d7db4 ("stmmac: pci: Add dwmac support for Loongson")
> Signed-off-by: Liu Peibao <liupeibao@loongson.cn>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] stmmac: dwmac-loongson: fix invalid mdio_node
  2022-11-01  6:02 [PATCH] stmmac: dwmac-loongson: fix invalid mdio_node Liu Peibao
  2022-11-01 23:42 ` Andrew Lunn
@ 2022-11-03  3:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-03  3:40 UTC (permalink / raw)
  To: Liu Peibao
  Cc: peppe.cavallaro, alexandre.torgue, joabreu, davem, edumazet,
	kuba, pabeni, jiaxun.yang, chenhuacai, lvjianmin, zhuyinbo,
	netdev, linux-kernel

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue,  1 Nov 2022 14:02:18 +0800 you wrote:
> In current code "plat->mdio_node" is always NULL, the mdio
> support is lost as there is no "mdio_bus_data". The original
> driver could work as the "mdio" variable is never set to
> false, which is described in commit <b0e03950dd71> ("stmmac:
> dwmac-loongson: fix uninitialized variable ......"). And
> after this commit merged, the "mdio" variable is always
> false, causing the mdio supoort logic lost.
> 
> [...]

Here is the summary with links:
  - stmmac: dwmac-loongson: fix invalid mdio_node
    https://git.kernel.org/netdev/net/c/2ae34111fe4e

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-03  3:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-01  6:02 [PATCH] stmmac: dwmac-loongson: fix invalid mdio_node Liu Peibao
2022-11-01 23:42 ` Andrew Lunn
2022-11-03  3:40 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.