]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
Altera TSE: Add support for no PHY
authorWalter Lozano <walter@vanguardiasur.com.ar>
Fri, 3 Oct 2014 18:09:01 +0000 (15:09 -0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Oct 2014 01:39:40 +0000 (21:39 -0400)
This patch avoids PHY and MDIO probing if no PHY chip is present.
This is the case mainly in optical links where there is no need for
PHY chip, and therefore no need of MDIO. In this scenario Ethernet
MAC is directly connected to an optical module through an external
SFP transceiver.

Signed-off-by: Walter Lozano <walter@vanguardiasur.com.ar>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/altera/altera_tse_main.c

index 95a30a30f7ff3695d6e5a2903ac5f1c8099eb9a4..4efc4355d34537e79632844e3e493fa25240a215 100644 (file)
@@ -736,6 +736,10 @@ static int altera_tse_phy_get_addr_mdio_create(struct net_device *dev)
 
        priv->phy_iface = of_get_phy_mode(np);
 
+       /* Avoid get phy addr and create mdio if no phy is present */
+       if (!priv->phy_iface)
+               return 0;
+
        /* try to get PHY address from device tree, use PHY autodetection if
         * no valid address is given
         */
@@ -770,6 +774,10 @@ static int init_phy(struct net_device *dev)
        struct phy_device *phydev;
        struct device_node *phynode;
 
+       /* Avoid init phy in case of no phy present */
+       if (!priv->phy_iface)
+               return 0;
+
        priv->oldlink = 0;
        priv->oldspeed = 0;
        priv->oldduplex = -1;