diff mbox

[net-next,01/11] net: dsa: legacy: assign dst->applied

Message ID 20170814222242.10643-2-vivien.didelot@savoirfairelinux.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Vivien Didelot Aug. 14, 2017, 10:22 p.m. UTC
The "applied" boolean of the dsa_switch_tree is only set in the new
bindings. This patch sets it in the legacy code as well.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 net/dsa/legacy.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Andrew Lunn Aug. 14, 2017, 10:58 p.m. UTC | #1
On Mon, Aug 14, 2017 at 06:22:32PM -0400, Vivien Didelot wrote:
> The "applied" boolean of the dsa_switch_tree is only set in the new
> bindings. This patch sets it in the legacy code as well.

What is missing here is: Why? 

I see the next patch does a WARN_ON(!applied). Why have a WARN_ON?

  Andrew
diff mbox

Patch

diff --git a/net/dsa/legacy.c b/net/dsa/legacy.c
index 91e6f7981d39..a6a0849483d1 100644
--- a/net/dsa/legacy.c
+++ b/net/dsa/legacy.c
@@ -605,6 +605,7 @@  static int dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev,
 	 */
 	wmb();
 	dev->dsa_ptr = dst;
+	dst->applied = true;
 
 	return 0;
 }
@@ -689,6 +690,8 @@  static void dsa_remove_dst(struct dsa_switch_tree *dst)
 	dsa_cpu_port_ethtool_restore(dst->cpu_dp);
 
 	dev_put(dst->cpu_dp->netdev);
+
+	dst->applied = false;
 }
 
 static int dsa_remove(struct platform_device *pdev)