Skip to content

Commit

Permalink
Altera TSE: Add support for no PHY
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Walter Lozano authored and David S. Miller committed Oct 6, 2014
1 parent 004fa11 commit 3354313
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/ethernet/altera/altera_tse_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3354313

Please sign in to comment.