diff options
Diffstat (limited to 'net/dsa/port.c')
-rw-r--r-- | net/dsa/port.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/dsa/port.c b/net/dsa/port.c index 2d7e01b23572..2a2a878b5ce3 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c | |||
@@ -69,7 +69,6 @@ static void dsa_port_set_state_now(struct dsa_port *dp, u8 state) | |||
69 | 69 | ||
70 | int dsa_port_enable(struct dsa_port *dp, struct phy_device *phy) | 70 | int dsa_port_enable(struct dsa_port *dp, struct phy_device *phy) |
71 | { | 71 | { |
72 | u8 stp_state = dp->bridge_dev ? BR_STATE_BLOCKING : BR_STATE_FORWARDING; | ||
73 | struct dsa_switch *ds = dp->ds; | 72 | struct dsa_switch *ds = dp->ds; |
74 | int port = dp->index; | 73 | int port = dp->index; |
75 | int err; | 74 | int err; |
@@ -80,7 +79,8 @@ int dsa_port_enable(struct dsa_port *dp, struct phy_device *phy) | |||
80 | return err; | 79 | return err; |
81 | } | 80 | } |
82 | 81 | ||
83 | dsa_port_set_state_now(dp, stp_state); | 82 | if (!dp->bridge_dev) |
83 | dsa_port_set_state_now(dp, BR_STATE_FORWARDING); | ||
84 | 84 | ||
85 | return 0; | 85 | return 0; |
86 | } | 86 | } |
@@ -90,7 +90,8 @@ void dsa_port_disable(struct dsa_port *dp, struct phy_device *phy) | |||
90 | struct dsa_switch *ds = dp->ds; | 90 | struct dsa_switch *ds = dp->ds; |
91 | int port = dp->index; | 91 | int port = dp->index; |
92 | 92 | ||
93 | dsa_port_set_state_now(dp, BR_STATE_DISABLED); | 93 | if (!dp->bridge_dev) |
94 | dsa_port_set_state_now(dp, BR_STATE_DISABLED); | ||
94 | 95 | ||
95 | if (ds->ops->port_disable) | 96 | if (ds->ops->port_disable) |
96 | ds->ops->port_disable(ds, port, phy); | 97 | ds->ops->port_disable(ds, port, phy); |