]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Jan 2017 03:01:22 +0000 (22:01 -0500)
commita054dac4a34bba8a8a3f4694aace2cf8950c6ed8
treeda293a8457b7a372f3fd97845272996359329f3c
parent2949ef61d8b452d65d13cbab300adc4f471f2233
net: dsa: bcm_sf2: Do not clobber b53_switch_ops

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: 2e6c31aad854 ("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>
drivers/net/dsa/bcm_sf2.c