[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170623173316.23017-5-f.fainelli@gmail.com>
Date: Fri, 23 Jun 2017 10:33:16 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: netdev@...r.kernel.org
Cc: Florian Fainelli <f.fainelli@...il.com>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...oirfairelinux.com>,
"David S. Miller" <davem@...emloft.net>,
Sean Wang <sean.wang@...iatek.com>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
Russell King <rmk+kernel@...linux.org.uk>,
devicetree@...r.kernel.org (open list:OPEN FIRMWARE AND FLATTENED
DEVICE TREE BINDINGS), linux-kernel@...r.kernel.org (open list),
david.wu@...k-chips.com, opendmb@...il.com
Subject: [PATCH net-next 4/4] net: dsa: bcm_sf2: 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 <f.fainelli@...il.com>
---
drivers/net/dsa/bcm_sf2.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 76e98e8ed315..648f91b58d1e 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -498,10 +498,8 @@ static void bcm_sf2_identify_ports(struct bcm_sf2_priv *priv,
struct device_node *dn)
{
struct device_node *port;
- const char *phy_mode_str;
int mode;
unsigned int port_num;
- int ret;
priv->moca_port = -1;
@@ -515,15 +513,11 @@ static void bcm_sf2_identify_ports(struct bcm_sf2_priv *priv,
* time
*/
mode = of_get_phy_mode(port);
- if (mode < 0) {
- ret = of_property_read_string(port, "phy-mode",
- &phy_mode_str);
- if (ret < 0)
- continue;
-
- if (!strcasecmp(phy_mode_str, "internal"))
- priv->int_phy_mask |= 1 << port_num;
- }
+ if (mode < 0)
+ continue;
+
+ if (mode == PHY_INTERFACE_MODE_INTERNAL)
+ priv->int_phy_mask |= 1 << port_num;
if (mode == PHY_INTERFACE_MODE_MOCA)
priv->moca_port = port_num;
--
2.9.3
Powered by blists - more mailing lists