]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
net: systemport: use the new fixed PHY helpers
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 22 May 2014 16:47:46 +0000 (09:47 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 May 2014 19:16:43 +0000 (15:16 -0400)
of_phy_connect_fixed_link() is becoming obsolete, and also required
platform code to register the fixed PHYs at the specified addresses for
those to be usable. Get rid of it and use the new of_phy_is_fixed_link()
plus of_phy_register_fixed_link() helpers to transition over the new
scheme.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bcmsysport.c
drivers/net/ethernet/broadcom/bcmsysport.h

index d40c5b969e9e8753dac18429c41b64eb26d66e2f..dc708a888f802ccc8e910bfdd46944fa4a8f78c5 100644 (file)
@@ -1327,8 +1327,8 @@ static int bcm_sysport_open(struct net_device *dev)
        /* Read CRC forward */
        priv->crc_fwd = !!(umac_readl(priv, UMAC_CMD) & CMD_CRC_FWD);
 
-       priv->phydev = of_phy_connect_fixed_link(dev, bcm_sysport_adj_link,
-                                                       priv->phy_interface);
+       priv->phydev = of_phy_connect(dev, priv->phy_dn, bcm_sysport_adj_link,
+                                       0, priv->phy_interface);
        if (!priv->phydev) {
                netdev_err(dev, "could not attach to PHY\n");
                return -ENODEV;
@@ -1551,6 +1551,19 @@ static int bcm_sysport_probe(struct platform_device *pdev)
        if (priv->phy_interface < 0)
                priv->phy_interface = PHY_INTERFACE_MODE_GMII;
 
+       /* In the case of a fixed PHY, the DT node associated
+        * to the PHY is the Ethernet MAC DT node.
+        */
+       if (of_phy_is_fixed_link(dn)) {
+               ret = of_phy_register_fixed_link(dn);
+               if (ret) {
+                       dev_err(&pdev->dev, "failed to register fixed PHY\n");
+                       goto err;
+               }
+
+               priv->phy_dn = dn;
+       }
+
        /* Initialize netdevice members */
        macaddr = of_get_mac_address(dn);
        if (!macaddr || !is_valid_ether_addr(macaddr)) {
index abdeb62616dff7c521f0fbad93d76c1a4efad40e..73fd04a947970decbec8cac3ac4bbb464c56a4a6 100644 (file)
@@ -656,6 +656,7 @@ struct bcm_sysport_priv {
        unsigned int            rx_c_index;
 
        /* PHY device */
+       struct device_node      *phy_dn;
        struct phy_device       *phydev;
        phy_interface_t         phy_interface;
        int                     old_pause;