mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] net: stmmac: fix the mistake of the device tree property string of reset gpio in stmmac_mdio_reset
@ 2024-07-20  4:00 Zhouyi Zhou
  2024-07-20 12:35 ` Andrew Lunn
  2024-07-23 10:47 ` Paolo Abeni
  0 siblings, 2 replies; 3+ messages in thread
From: Zhouyi Zhou @ 2024-07-20  4:00 UTC (permalink / raw)
  To: alexandre.torgue, joabreu, davem, edumazet, pabeni, kuba,
	mcoquelin.stm32, andrew, linus.walleij, martin.blumenstingl,
	netdev, linux-stm32, linux-arm-kernel, linux-kernel
  Cc: zhili.liu, Zhouyi Zhou, wangzhiqiang

From: "zhili.liu" <zhili.liu@ucas.com.cn>

According to Documentation/devicetree/bindings/net/snps,dwmac.yaml,
the device tree property of PHY Reset GPIO should be "snps,reset-gpio".

Use string "snps,reset-gpio" instead of "snps,reset" in stmmac_mdio_reset
when invoking devm_gpiod_get_optional.

Fixes: 7c86f20d15b7 ("net: stmmac: use GPIO descriptors in stmmac_mdio_reset")

Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
Signed-off-by: wangzhiqiang <zhiqiangwang@ucas.com.cn>
Signed-off-by: zhili.liu <zhili.liu@ucas.com.cn>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index 03f90676b3ad..b052222458b5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -462,7 +462,7 @@ int stmmac_mdio_reset(struct mii_bus *bus)
 		u32 delays[3] = { 0, 0, 0 };
 
 		reset_gpio = devm_gpiod_get_optional(priv->device,
-						     "snps,reset",
+						     "snps,reset-gpio",
 						     GPIOD_OUT_LOW);
 		if (IS_ERR(reset_gpio))
 			return PTR_ERR(reset_gpio);
-- 
2.25.1


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

* Re: [PATCH] net: stmmac: fix the mistake of the device tree property string of reset gpio in stmmac_mdio_reset
  2024-07-20  4:00 [PATCH] net: stmmac: fix the mistake of the device tree property string of reset gpio in stmmac_mdio_reset Zhouyi Zhou
@ 2024-07-20 12:35 ` Andrew Lunn
  2024-07-23 10:47 ` Paolo Abeni
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2024-07-20 12:35 UTC (permalink / raw)
  To: Zhouyi Zhou
  Cc: alexandre.torgue, joabreu, davem, edumazet, pabeni, kuba,
	mcoquelin.stm32, linus.walleij, martin.blumenstingl, netdev,
	linux-stm32, linux-arm-kernel, linux-kernel, zhili.liu,
	wangzhiqiang

On Sat, Jul 20, 2024 at 04:00:27AM +0000, Zhouyi Zhou wrote:
> From: "zhili.liu" <zhili.liu@ucas.com.cn>
> 
> According to Documentation/devicetree/bindings/net/snps,dwmac.yaml,
> the device tree property of PHY Reset GPIO should be "snps,reset-gpio".
> 
> Use string "snps,reset-gpio" instead of "snps,reset" in stmmac_mdio_reset
> when invoking devm_gpiod_get_optional.

Have you found the current code does not work on a board you have, or
is this by code inspection?

https://elixir.bootlin.com/linux/v6.10/source/drivers/gpio/gpiolib-of.c#L687
https://elixir.bootlin.com/linux/v6.10/source/drivers/gpio/gpiolib.h#L93

See how it appends -gpio and -gpios to the name.

I also randomly check a few users of devm_gpiod_get_optional() and non
of them include the -gpio in the name, leaving the GPIO core to do it.

	Andrew

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

* Re: [PATCH] net: stmmac: fix the mistake of the device tree property string of reset gpio in stmmac_mdio_reset
  2024-07-20  4:00 [PATCH] net: stmmac: fix the mistake of the device tree property string of reset gpio in stmmac_mdio_reset Zhouyi Zhou
  2024-07-20 12:35 ` Andrew Lunn
@ 2024-07-23 10:47 ` Paolo Abeni
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Abeni @ 2024-07-23 10:47 UTC (permalink / raw)
  To: Zhouyi Zhou, alexandre.torgue, joabreu, davem, edumazet, kuba,
	mcoquelin.stm32, andrew, linus.walleij, martin.blumenstingl,
	netdev, linux-stm32, linux-arm-kernel, linux-kernel
  Cc: zhili.liu, wangzhiqiang

On 7/20/24 06:00, Zhouyi Zhou wrote:
> From: "zhili.liu" <zhili.liu@ucas.com.cn>
> 
> According to Documentation/devicetree/bindings/net/snps,dwmac.yaml,
> the device tree property of PHY Reset GPIO should be "snps,reset-gpio".
> 
> Use string "snps,reset-gpio" instead of "snps,reset" in stmmac_mdio_reset
> when invoking devm_gpiod_get_optional.
> 
> Fixes: 7c86f20d15b7 ("net: stmmac: use GPIO descriptors in stmmac_mdio_reset")
> 
> Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
> Signed-off-by: wangzhiqiang <zhiqiangwang@ucas.com.cn>
> Signed-off-by: zhili.liu <zhili.liu@ucas.com.cn>

Apart from the more relevant concern raised from Andrew, please note 
that you should avoid empty lines in the tag area, between the 'fixes' 
tag and the SoB tag.

Thanks,

Paolo


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

end of thread, other threads:[~2024-07-23 10:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-20  4:00 [PATCH] net: stmmac: fix the mistake of the device tree property string of reset gpio in stmmac_mdio_reset Zhouyi Zhou
2024-07-20 12:35 ` Andrew Lunn
2024-07-23 10:47 ` Paolo Abeni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®