Skip to content

Commit 40bc8b0

Browse files
ffainellidavem330
authored andcommitted
net: bcmgenet: Remove special handling of "internal" phy-mode
The PHY library now supports an "internal" phy-mode, thus making our custom parsing code now unnecessary. Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 735d8a1 commit 40bc8b0

File tree

1 file changed

+8
-16
lines changed
  • drivers/net/ethernet/broadcom/genet

1 file changed

+8
-16
lines changed

drivers/net/ethernet/broadcom/genet/bcmmii.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,8 @@ int bcmgenet_mii_config(struct net_device *dev)
251251
priv->ext_phy = !priv->internal_phy &&
252252
(priv->phy_interface != PHY_INTERFACE_MODE_MOCA);
253253

254-
if (priv->internal_phy)
255-
priv->phy_interface = PHY_INTERFACE_MODE_NA;
256-
257254
switch (priv->phy_interface) {
258-
case PHY_INTERFACE_MODE_NA:
255+
case PHY_INTERFACE_MODE_INTERNAL:
259256
case PHY_INTERFACE_MODE_MOCA:
260257
/* Irrespective of the actually configured PHY speed (100 or
261258
* 1000) GENETv4 only has an internal GPHY so we will just end
@@ -471,7 +468,6 @@ static int bcmgenet_mii_of_init(struct bcmgenet_priv *priv)
471468
{
472469
struct device_node *dn = priv->pdev->dev.of_node;
473470
struct device *kdev = &priv->pdev->dev;
474-
const char *phy_mode_str = NULL;
475471
struct phy_device *phydev = NULL;
476472
char *compat;
477473
int phy_mode;
@@ -510,23 +506,19 @@ static int bcmgenet_mii_of_init(struct bcmgenet_priv *priv)
510506

511507
/* Get the link mode */
512508
phy_mode = of_get_phy_mode(dn);
509+
if (phy_mode < 0) {
510+
dev_err(kdev, "invalid PHY mode property\n");
511+
return phy_mode;
512+
}
513+
513514
priv->phy_interface = phy_mode;
514515

515516
/* We need to specifically look up whether this PHY interface is internal
516517
* or not *before* we even try to probe the PHY driver over MDIO as we
517518
* may have shut down the internal PHY for power saving purposes.
518519
*/
519-
if (phy_mode < 0) {
520-
ret = of_property_read_string(dn, "phy-mode", &phy_mode_str);
521-
if (ret < 0) {
522-
dev_err(kdev, "invalid PHY mode property\n");
523-
return ret;
524-
}
525-
526-
priv->phy_interface = PHY_INTERFACE_MODE_NA;
527-
if (!strcasecmp(phy_mode_str, "internal"))
528-
priv->internal_phy = true;
529-
}
520+
if (priv->phy_interface == PHY_INTERFACE_MODE_INTERNAL)
521+
priv->internal_phy = true;
530522

531523
/* Make sure we initialize MoCA PHYs with a link down */
532524
if (phy_mode == PHY_INTERFACE_MODE_MOCA) {

0 commit comments

Comments
 (0)