Skip to contentSkip to conversation

net: stmmac: fix the mistake of the device tree property string of reset gpio in stmmac_mdio_reset

PATCH In review Zhouyi Zhou 3 participants 3 messages Jul 20, 2024 – Jul 23, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: stmmac: fix the mistake of the device tree property string of reset gpio in stmmac_mdio_reset

From: "zhili.liu" <[email protected]>

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")
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +1 -1
index 03f90676b3ad..b052222458b5 100644
@@ -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);
Signature · 1 line
2.25.1
#1 lore raw
Quoted 7 lines · Zhouyi Zhou

From: "zhili.liu" <[email protected]>

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

maintainer
#2 lore raw
In reply to Zhouyi Zhou
Quoted 5 lines · Zhouyi Zhou

From: "zhili.liu" <[email protected]>

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

Quoted 8 lines

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")

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