From: Padmanabhan Rajanbabu Date: Thu, 19 Dec 2019 10:17:01 +0000 (+0530) Subject: net: stmmac: platform: Fix MDIO init for platforms without PHY X-Git-Tag: v5.4.7~409 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bfdbfd28f76028b960458d107dc4ae9240c928b3;p=thirdparty%2Fkernel%2Fstable.git net: stmmac: platform: Fix MDIO init for platforms without PHY [ Upstream commit d3e014ec7d5ebe9644b5486bc530b91e62bbf624 ] The current implementation of "stmmac_dt_phy" function initializes the MDIO platform bus data, even in the absence of PHY. This fix will skip MDIO initialization if there is no PHY present. Fixes: 7437127 ("net: stmmac: Convert to phylink and remove phylib logic") Acked-by: Jayati Sahu Signed-off-by: Sriram Dash Signed-off-by: Padmanabhan Rajanbabu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 170c3a052b14b..1f230bd854c4a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -320,7 +320,7 @@ out: static int stmmac_dt_phy(struct plat_stmmacenet_data *plat, struct device_node *np, struct device *dev) { - bool mdio = true; + bool mdio = false; static const struct of_device_id need_mdio_ids[] = { { .compatible = "snps,dwc-qos-ethernet-4.10" }, {},