diff options
author | Giuseppe CAVALLARO <peppe.cavallaro@st.com> | 2016-04-01 03:07:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-01 14:38:58 -0400 |
commit | d7e944c8ddc0983640a9a32868fb217485d12ca2 (patch) | |
tree | 9f051ca5d1b22cac973187e2e92d420322ad9576 | |
parent | a00e3ab64be2e482bd25fe30bdc9bfa6e2b0cf1c (diff) |
Revert "stmmac: Fix 'eth0: No PHY found' regression"
This reverts commit 88f8b1bb41c6208f81b6a480244533ded7b59493.
due to problems on GeekBox and Banana Pi M1 board when
connected to a real transceiver instead of a switch via
fixed-link.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Gabriel Fernandez <gabriel.fernandez@linaro.org>
Cc: Andreas Färber <afaerber@suse.de>
Cc: Frank Schäfer <fschaefer.oss@googlemail.com>
Cc: Dinh Nguyen <dinh.linux@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 11 | ||||
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 9 | ||||
-rw-r--r-- | include/linux/stmmac.h | 1 |
3 files changed, 11 insertions, 10 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index ea76129dafc2..af09ced53bd8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | |||
@@ -199,12 +199,21 @@ int stmmac_mdio_register(struct net_device *ndev) | |||
199 | struct stmmac_priv *priv = netdev_priv(ndev); | 199 | struct stmmac_priv *priv = netdev_priv(ndev); |
200 | struct stmmac_mdio_bus_data *mdio_bus_data = priv->plat->mdio_bus_data; | 200 | struct stmmac_mdio_bus_data *mdio_bus_data = priv->plat->mdio_bus_data; |
201 | int addr, found; | 201 | int addr, found; |
202 | struct device_node *mdio_node = priv->plat->mdio_node; | 202 | struct device_node *mdio_node = NULL; |
203 | struct device_node *child_node = NULL; | ||
203 | 204 | ||
204 | if (!mdio_bus_data) | 205 | if (!mdio_bus_data) |
205 | return 0; | 206 | return 0; |
206 | 207 | ||
207 | if (IS_ENABLED(CONFIG_OF)) { | 208 | if (IS_ENABLED(CONFIG_OF)) { |
209 | for_each_child_of_node(priv->device->of_node, child_node) { | ||
210 | if (of_device_is_compatible(child_node, | ||
211 | "snps,dwmac-mdio")) { | ||
212 | mdio_node = child_node; | ||
213 | break; | ||
214 | } | ||
215 | } | ||
216 | |||
208 | if (mdio_node) { | 217 | if (mdio_node) { |
209 | netdev_dbg(ndev, "FOUND MDIO subnode\n"); | 218 | netdev_dbg(ndev, "FOUND MDIO subnode\n"); |
210 | } else { | 219 | } else { |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index dcbd2a1601e8..9cf181f839fd 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | |||
@@ -146,7 +146,6 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac) | |||
146 | struct device_node *np = pdev->dev.of_node; | 146 | struct device_node *np = pdev->dev.of_node; |
147 | struct plat_stmmacenet_data *plat; | 147 | struct plat_stmmacenet_data *plat; |
148 | struct stmmac_dma_cfg *dma_cfg; | 148 | struct stmmac_dma_cfg *dma_cfg; |
149 | struct device_node *child_node = NULL; | ||
150 | 149 | ||
151 | plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL); | 150 | plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL); |
152 | if (!plat) | 151 | if (!plat) |
@@ -177,19 +176,13 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac) | |||
177 | plat->phy_node = of_node_get(np); | 176 | plat->phy_node = of_node_get(np); |
178 | } | 177 | } |
179 | 178 | ||
180 | for_each_child_of_node(np, child_node) | ||
181 | if (of_device_is_compatible(child_node, "snps,dwmac-mdio")) { | ||
182 | plat->mdio_node = child_node; | ||
183 | break; | ||
184 | } | ||
185 | |||
186 | /* "snps,phy-addr" is not a standard property. Mark it as deprecated | 179 | /* "snps,phy-addr" is not a standard property. Mark it as deprecated |
187 | * and warn of its use. Remove this when phy node support is added. | 180 | * and warn of its use. Remove this when phy node support is added. |
188 | */ | 181 | */ |
189 | if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0) | 182 | if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0) |
190 | dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n"); | 183 | dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n"); |
191 | 184 | ||
192 | if ((plat->phy_node && !of_phy_is_fixed_link(np)) || !plat->mdio_node) | 185 | if ((plat->phy_node && !of_phy_is_fixed_link(np)) || plat->phy_bus_name) |
193 | plat->mdio_bus_data = NULL; | 186 | plat->mdio_bus_data = NULL; |
194 | else | 187 | else |
195 | plat->mdio_bus_data = | 188 | plat->mdio_bus_data = |
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 4bcf5a61aada..6e53fa8942a4 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h | |||
@@ -114,7 +114,6 @@ struct plat_stmmacenet_data { | |||
114 | int interface; | 114 | int interface; |
115 | struct stmmac_mdio_bus_data *mdio_bus_data; | 115 | struct stmmac_mdio_bus_data *mdio_bus_data; |
116 | struct device_node *phy_node; | 116 | struct device_node *phy_node; |
117 | struct device_node *mdio_node; | ||
118 | struct stmmac_dma_cfg *dma_cfg; | 117 | struct stmmac_dma_cfg *dma_cfg; |
119 | int clk_csr; | 118 | int clk_csr; |
120 | int has_gmac; | 119 | int has_gmac; |