]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: mv88e6xxx: add switch register helpers
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Mon, 20 Jun 2016 17:14:02 +0000 (13:14 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jun 2016 07:58:29 +0000 (03:58 -0400)
commitb348070b7df65873e74ba7de4bbae6ba34aa9bd8
tree37c7632161e3ad9f703785f7985576b8004c1a3f
parentf06d5ec6e3fe724878a8f95e33fb373c67b57d35
net: dsa: mv88e6xxx: add switch register helpers

The mixed assignments, allocations and registrations in the probe code
make it hard to follow the logic and figure out what is DSA or chip
specific.

Extract the struct dsa_switch related code in a simple
mv88e6xxx_register_switch helper function.

For symmetry in the code, add a mv88e6xxx_unregister_switch function.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx.c