summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
diff options
context:
space:
mode:
authorChen-Yu Tsai2014-01-17 14:24:45 +0100
committerDavid S. Miller2014-01-20 05:02:03 +0100
commit436f7ecdcc08f71ddc106b7bbe3bcbf1785f3bff (patch)
tree90017636b2d4d51cc9cb1a7a4caa028c2806ffc8 /drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
parentnet: stmmac: Honor DT parameter to force DMA store and forward mode (diff)
downloadkernel-qcow2-linux-436f7ecdcc08f71ddc106b7bbe3bcbf1785f3bff.tar.gz
kernel-qcow2-linux-436f7ecdcc08f71ddc106b7bbe3bcbf1785f3bff.tar.xz
kernel-qcow2-linux-436f7ecdcc08f71ddc106b7bbe3bcbf1785f3bff.zip
net: stmmac: Deprecate snps, phy-addr and auto-detect PHY address
The snps,phy-addr device tree property is non-standard, and should be removed in favor of proper phy node support. Remove it from the binding documents and warn if the property is still used. Most PHYs respond to address 0, but a few don't, so auto-detect PHY address by default, to make up for the lack of explicit address selection. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 634260e7dd3b..82110f141d09 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -50,7 +50,14 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
if (plat->bus_id < 0)
plat->bus_id = 0;
- of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr);
+ /* Default to phy auto-detection */
+ plat->phy_addr = -1;
+
+ /* "snps,phy-addr" is not a standard property. Mark it as deprecated
+ * and warn of its use. Remove this when phy node support is added.
+ */
+ if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0)
+ dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
plat->mdio_bus_data = devm_kzalloc(&pdev->dev,
sizeof(struct stmmac_mdio_bus_data),