]> Pileus Git - ~andy/linux/commitdiff
net: stmmac: Deprecate snps, phy-addr and auto-detect PHY address
authorChen-Yu Tsai <wens@csie.org>
Fri, 17 Jan 2014 13:24:45 +0000 (21:24 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Jan 2014 04:02:03 +0000 (20:02 -0800)
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>
Documentation/devicetree/bindings/net/stmmac.txt
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

index d132513e8fac447fb8920eefbca55793feb58f42..aefb63949619eaeba843a64ca0f323fa6ba4164c 100644 (file)
@@ -12,7 +12,6 @@ Required properties:
   property
 - phy-mode: String, operation mode of the PHY interface.
   Supported values are: "mii", "rmii", "gmii", "rgmii".
-- snps,phy-addr                phy address to connect to.
 - snps,reset-gpio      gpio number for phy reset.
 - snps,reset-active-low boolean flag to indicate if phy reset is active low.
 - snps,reset-delays-us  is triplet of delays
index 634260e7dd3bcd355bd30e5fc670606ee8672f0a..82110f141d09d89b4240880519e3d8f29bfe94f0 100644 (file)
@@ -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),