diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2011-11-25 14:36:19 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-26 14:48:15 -0500 |
commit | 98e673080bd90b9338428be92dd3597798aac3ed (patch) | |
tree | aea557e2596565fae249712ba652cf6e36e7def5 /net/dsa/mv88e6xxx.c | |
parent | 7df899c36cf09678bdef1824ce591ef4ac0e9864 (diff) | |
download | op-kernel-dev-98e673080bd90b9338428be92dd3597798aac3ed.zip op-kernel-dev-98e673080bd90b9338428be92dd3597798aac3ed.tar.gz |
mv88e6xxx: Combine mv88e6131 and mv88e612_61_65 drivers
These drivers share a lot of code, so if we make them modular they
should be built into the same module. Therefore, link them together
and merge their respective module init and exit functions.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/mv88e6xxx.c')
-rw-r--r-- | net/dsa/mv88e6xxx.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/net/dsa/mv88e6xxx.c b/net/dsa/mv88e6xxx.c index efe661a..50fd860 100644 --- a/net/dsa/mv88e6xxx.c +++ b/net/dsa/mv88e6xxx.c @@ -520,3 +520,26 @@ void mv88e6xxx_get_ethtool_stats(struct dsa_switch *ds, mutex_unlock(&ps->stats_mutex); } + +static int __init mv88e6xxx_init(void) +{ +#if IS_ENABLED(CONFIG_NET_DSA_MV88E6131) + register_switch_driver(&mv88e6131_switch_driver); +#endif +#if IS_ENABLED(CONFIG_NET_DSA_MV88E6123_61_65) + register_switch_driver(&mv88e6123_61_65_switch_driver); +#endif + return 0; +} +module_init(mv88e6xxx_init); + +static void __exit mv88e6xxx_cleanup(void) +{ +#if IS_ENABLED(CONFIG_NET_DSA_MV88E6123_61_65) + unregister_switch_driver(&mv88e6123_61_65_switch_driver); +#endif +#if IS_ENABLED(CONFIG_NET_DSA_MV88E6131) + unregister_switch_driver(&mv88e6131_switch_driver); +#endif +} +module_exit(mv88e6xxx_cleanup); |