net: dsa: bcm_sf2: Do not clobber b53_switch_ops
authorFlorian Fainelli <f.fainelli@gmail.com>
Sun, 8 Jan 2017 05:01:56 +0000 (21:01 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 15 Jan 2017 12:42:54 +0000 (13:42 +0100)
commitac77aab46168435a88911f5a3e1b9e0c246d3c14
tree682c6392d30e41a823489523402984b7faf24e50
parentb55f6ca7380d609a40e0441d345404d100da3d45
net: dsa: bcm_sf2: Do not clobber b53_switch_ops

[ Upstream commit a4c61b92b3a4cbda35bb0251a5063a68f0861b2c ]

We make the bcm_sf2 driver override ds->ops which points to
b53_switch_ops since b53_switch_alloc() did the assignent. This is all
well and good until a second b53 switch comes in, and ends up using the
bcm_sf2 operations. Make a proper local copy, substitute the ds->ops
pointer and then override the operations.

Fixes: f458995b9ad8 ("net: dsa: bcm_sf2: Utilize core B53 driver when possible")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/dsa/bcm_sf2.c