diff mbox series

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

Message ID 20240720040027.734420-1-zhouzhouyi@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series net: stmmac: fix the mistake of the device tree property string of reset gpio in stmmac_mdio_reset | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 273 this patch: 273
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 12 of 12 maintainers
netdev/build_clang success Errors and warnings before: 281 this patch: 281
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes fail Problems with Fixes tag: 1
netdev/build_allmodconfig_warn success Errors and warnings before: 281 this patch: 281
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 21 this patch: 21
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-07-20--09-00 (tests: 695)

Commit Message

Zhouyi Zhou July 20, 2024, 4 a.m. UTC
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(-)

Comments

Andrew Lunn July 20, 2024, 12:35 p.m. UTC | #1
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
Paolo Abeni July 23, 2024, 10:47 a.m. UTC | #2
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
diff mbox series

Patch

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