Re: [PATCH] net: stmmac: fix the mistake of the device tree property string of reset gpio in stmmac_mdio_reset

From: Andrew Lunn
Date: Sat Jul 20 2024 - 08:36:14 EST


On Sat, Jul 20, 2024 at 04:00:27AM +0000, Zhouyi Zhou wrote:
> From: "zhili.liu" <zhili.liu@xxxxxxxxxxx>
>
> 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