The dm_gpio_free() is never called, because for stm32, the phy_reset_gpio pointer is never valid. This is because only tegra186 ever claims the phy_reset_gpio, all other platforms use the PHY framework to reset the PHY instead. Drop the dm_gpio_free() and dm_gpio_is_valid().
Reviewed-by: Ramon Fried <rfried....@gmail.com> Signed-off-by: Marek Vasut <ma...@denx.de> --- Cc: "Ariel D'Alessandro" <ariel.dalessan...@collabora.com> Cc: "NXP i.MX U-Boot Team" <uboot-...@nxp.com> Cc: Andrey Zhizhikin <andrey.zhizhi...@leica-geosystems.com> Cc: Fabio Estevam <feste...@gmail.com> Cc: Joe Hershberger <joe.hershber...@ni.com> Cc: Lukasz Majewski <lu...@denx.de> Cc: Marcel Ziswiler <marcel.ziswi...@toradex.com> Cc: Marek Vasut <ma...@denx.de> Cc: Michael Trimarchi <mich...@amarulasolutions.com> Cc: Peng Fan <peng....@nxp.com> Cc: Ramon Fried <rfried....@gmail.com> Cc: Sean Anderson <sean...@gmail.com> Cc: Stefano Babic <sba...@denx.de> Cc: Tim Harvey <thar...@gateworks.com> Cc: Tommaso Merciai <tommaso.merc...@amarulasolutions.com> Cc: u-boot@lists.denx.de --- V2: - Add RB from Ramon - Mark eqos variable in eqos_remove_resources_stm32() with __maybe_unused --- drivers/net/dwc_eth_qos.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c index 44d05908894..3b62b283c45 100644 --- a/drivers/net/dwc_eth_qos.c +++ b/drivers/net/dwc_eth_qos.c @@ -1490,7 +1490,7 @@ static int eqos_remove_resources_tegra186(struct udevice *dev) static int eqos_remove_resources_stm32(struct udevice *dev) { - struct eqos_priv *eqos = dev_get_priv(dev); + struct eqos_priv * __maybe_unused eqos = dev_get_priv(dev); debug("%s(dev=%p):\n", __func__, dev); @@ -1502,9 +1502,6 @@ static int eqos_remove_resources_stm32(struct udevice *dev) clk_free(&eqos->clk_ck); #endif - if (dm_gpio_is_valid(&eqos->phy_reset_gpio)) - dm_gpio_free(dev, &eqos->phy_reset_gpio); - debug("%s: OK\n", __func__); return 0; } -- 2.39.1