net: dsa: provide a second modalias to tag proto drivers based on their name
[linux-2.6-block.git] / net / dsa / tag_ocelot.c
index 0d81f172b7a6e6449ac4a4559826d0694e617fe0..8cc31ab47e282060da00d9329c6107c8e6849cc8 100644 (file)
@@ -4,6 +4,9 @@
 #include <linux/dsa/ocelot.h>
 #include "dsa_priv.h"
 
+#define OCELOT_NAME    "ocelot"
+#define SEVILLE_NAME   "seville"
+
 /* If the port is under a VLAN-aware bridge, remove the VLAN header from the
  * payload and move it into the DSA tag, which will make the switch classify
  * the packet to the bridge VLAN. Otherwise, leave the classified VLAN at zero,
@@ -183,7 +186,7 @@ static struct sk_buff *ocelot_rcv(struct sk_buff *skb,
 }
 
 static const struct dsa_device_ops ocelot_netdev_ops = {
-       .name                   = "ocelot",
+       .name                   = OCELOT_NAME,
        .proto                  = DSA_TAG_PROTO_OCELOT,
        .xmit                   = ocelot_xmit,
        .rcv                    = ocelot_rcv,
@@ -192,10 +195,10 @@ static const struct dsa_device_ops ocelot_netdev_ops = {
 };
 
 DSA_TAG_DRIVER(ocelot_netdev_ops);
-MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_OCELOT);
+MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_OCELOT, OCELOT_NAME);
 
 static const struct dsa_device_ops seville_netdev_ops = {
-       .name                   = "seville",
+       .name                   = SEVILLE_NAME,
        .proto                  = DSA_TAG_PROTO_SEVILLE,
        .xmit                   = seville_xmit,
        .rcv                    = ocelot_rcv,
@@ -204,7 +207,7 @@ static const struct dsa_device_ops seville_netdev_ops = {
 };
 
 DSA_TAG_DRIVER(seville_netdev_ops);
-MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_SEVILLE);
+MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_SEVILLE, SEVILLE_NAME);
 
 static struct dsa_tag_driver *ocelot_tag_driver_array[] = {
        &DSA_TAG_DRIVER_NAME(ocelot_netdev_ops),