summaryrefslogtreecommitdiff
path: root/drivers/net/dsa/lan9303-core.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-08-20 22:33:49 +0300
committerDavid S. Miller <davem@davemloft.net>2019-08-20 22:33:49 +0300
commitb1b5133db19ca2868b4fedaee0b3660559acc142 (patch)
tree7c7f05445286e31dd13c34370249ad284baa40c5 /drivers/net/dsa/lan9303-core.c
parentd2187f8e445403b7aeb08e64c1528761154e9ab3 (diff)
parentfc0bc0190bc5ea1e44317c84c9f92f9196a7441b (diff)
downloadlinux-b1b5133db19ca2868b4fedaee0b3660559acc142.tar.xz
Merge branch 'net-dsa-enable-and-disable-all-ports'
Vivien Didelot says: ==================== net: dsa: enable and disable all ports The DSA stack currently calls the .port_enable and .port_disable switch callbacks for slave ports only. However, it is useful to call them for all port types. For example this allows some drivers to delay the optimization of power consumption after the switch is setup. This can also help reducing the setup code of drivers a bit. The first DSA core patches enable and disable all ports of a switch, regardless their type. The last mv88e6xxx patches remove redundant code from the driver setup and the said callbacks, now that they handle SERDES power for all ports. Changes in v2: do not guard .port_disable for broadcom switches. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/lan9303-core.c')
-rw-r--r--drivers/net/dsa/lan9303-core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c
index 7a2063e7737a..bbec86b9418e 100644
--- a/drivers/net/dsa/lan9303-core.c
+++ b/drivers/net/dsa/lan9303-core.c
@@ -1079,6 +1079,9 @@ static int lan9303_port_enable(struct dsa_switch *ds, int port,
{
struct lan9303 *chip = ds->priv;
+ if (!dsa_is_user_port(ds, port))
+ return 0;
+
return lan9303_enable_processing_port(chip, port);
}
@@ -1086,6 +1089,9 @@ static void lan9303_port_disable(struct dsa_switch *ds, int port)
{
struct lan9303 *chip = ds->priv;
+ if (!dsa_is_user_port(ds, port))
+ return;
+
lan9303_disable_processing_port(chip, port);
lan9303_phy_write(ds, chip->phy_addr_base + port, MII_BMCR, BMCR_PDOWN);
}