net: dsa: Sort DSA tagging protocol drivers
authorAndrew Lunn <andrew@lunn.ch>
Tue, 16 May 2017 20:40:07 +0000 (22:40 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 May 2017 19:19:40 +0000 (15:19 -0400)
With more tag protocols being added, regain some order by sorting the
entries in various places.

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

index 118a8bd2fd9a4f48b8068441c2897a596d1d7e52..ed767beca9c67b88aad4ad359a6ff10801fb9940 100644 (file)
@@ -27,13 +27,13 @@ struct fixed_phy_status;
 
 enum dsa_tag_protocol {
        DSA_TAG_PROTO_NONE = 0,
+       DSA_TAG_PROTO_BRCM,
        DSA_TAG_PROTO_DSA,
-       DSA_TAG_PROTO_TRAILER,
        DSA_TAG_PROTO_EDSA,
-       DSA_TAG_PROTO_BRCM,
-       DSA_TAG_PROTO_QCA,
-       DSA_TAG_PROTO_MTK,
        DSA_TAG_PROTO_LAN9303,
+       DSA_TAG_PROTO_MTK,
+       DSA_TAG_PROTO_QCA,
+       DSA_TAG_PROTO_TRAILER,
        DSA_TAG_LAST,           /* MUST BE LAST */
 };
 
index 81a0868edb1d619a6ade13b7817db90e7a2d69a2..297389b2ab35ea91bc6d932aa54391799bf6bf90 100644 (file)
@@ -25,16 +25,16 @@ config NET_DSA_TAG_DSA
 config NET_DSA_TAG_EDSA
        bool
 
-config NET_DSA_TAG_TRAILER
+config NET_DSA_TAG_LAN9303
        bool
 
-config NET_DSA_TAG_QCA
+config NET_DSA_TAG_MTK
        bool
 
-config NET_DSA_TAG_MTK
+config NET_DSA_TAG_TRAILER
        bool
 
-config NET_DSA_TAG_LAN9303
+config NET_DSA_TAG_QCA
        bool
 
 endif
index 0b747d75e65a265dc5059586e250a2b97ae3f067..f8c0251d1f4339ac61fffc6058e5ce0937560da7 100644 (file)
@@ -6,7 +6,7 @@ dsa_core-y += dsa.o slave.o dsa2.o switch.o legacy.o
 dsa_core-$(CONFIG_NET_DSA_TAG_BRCM) += tag_brcm.o
 dsa_core-$(CONFIG_NET_DSA_TAG_DSA) += tag_dsa.o
 dsa_core-$(CONFIG_NET_DSA_TAG_EDSA) += tag_edsa.o
-dsa_core-$(CONFIG_NET_DSA_TAG_TRAILER) += tag_trailer.o
-dsa_core-$(CONFIG_NET_DSA_TAG_QCA) += tag_qca.o
-dsa_core-$(CONFIG_NET_DSA_TAG_MTK) += tag_mtk.o
 dsa_core-$(CONFIG_NET_DSA_TAG_LAN9303) += tag_lan9303.o
+dsa_core-$(CONFIG_NET_DSA_TAG_MTK) += tag_mtk.o
+dsa_core-$(CONFIG_NET_DSA_TAG_QCA) += tag_qca.o
+dsa_core-$(CONFIG_NET_DSA_TAG_TRAILER) += tag_trailer.o
index 26130ae438da53f3f99a4e9fa712a572f40ca779..c0a1307c87ddb6c897d6506d75b5545ae40e1b8d 100644 (file)
@@ -40,26 +40,26 @@ static const struct dsa_device_ops none_ops = {
 };
 
 const struct dsa_device_ops *dsa_device_ops[DSA_TAG_LAST] = {
+#ifdef CONFIG_NET_DSA_TAG_BRCM
+       [DSA_TAG_PROTO_BRCM] = &brcm_netdev_ops,
+#endif
 #ifdef CONFIG_NET_DSA_TAG_DSA
        [DSA_TAG_PROTO_DSA] = &dsa_netdev_ops,
 #endif
 #ifdef CONFIG_NET_DSA_TAG_EDSA
        [DSA_TAG_PROTO_EDSA] = &edsa_netdev_ops,
 #endif
-#ifdef CONFIG_NET_DSA_TAG_TRAILER
-       [DSA_TAG_PROTO_TRAILER] = &trailer_netdev_ops,
+#ifdef CONFIG_NET_DSA_TAG_LAN9303
+       [DSA_TAG_PROTO_LAN9303] = &lan9303_netdev_ops,
 #endif
-#ifdef CONFIG_NET_DSA_TAG_BRCM
-       [DSA_TAG_PROTO_BRCM] = &brcm_netdev_ops,
+#ifdef CONFIG_NET_DSA_TAG_MTK
+       [DSA_TAG_PROTO_MTK] = &mtk_netdev_ops,
 #endif
 #ifdef CONFIG_NET_DSA_TAG_QCA
        [DSA_TAG_PROTO_QCA] = &qca_netdev_ops,
 #endif
-#ifdef CONFIG_NET_DSA_TAG_MTK
-       [DSA_TAG_PROTO_MTK] = &mtk_netdev_ops,
-#endif
-#ifdef CONFIG_NET_DSA_TAG_LAN9303
-       [DSA_TAG_PROTO_LAN9303] = &lan9303_netdev_ops,
+#ifdef CONFIG_NET_DSA_TAG_TRAILER
+       [DSA_TAG_PROTO_TRAILER] = &trailer_netdev_ops,
 #endif
        [DSA_TAG_PROTO_NONE] = &none_ops,
 };
index f4a88e4852138864081c1871fc882803e53247db..e9003b79cbbc360b2af1bca37ecb4996ffedd647 100644 (file)
@@ -75,25 +75,25 @@ void dsa_slave_unregister_notifier(void);
 int dsa_switch_register_notifier(struct dsa_switch *ds);
 void dsa_switch_unregister_notifier(struct dsa_switch *ds);
 
+/* tag_brcm.c */
+extern const struct dsa_device_ops brcm_netdev_ops;
+
 /* tag_dsa.c */
 extern const struct dsa_device_ops dsa_netdev_ops;
 
 /* tag_edsa.c */
 extern const struct dsa_device_ops edsa_netdev_ops;
 
-/* tag_trailer.c */
-extern const struct dsa_device_ops trailer_netdev_ops;
+/* tag_lan9303.c */
+extern const struct dsa_device_ops lan9303_netdev_ops;
 
-/* tag_brcm.c */
-extern const struct dsa_device_ops brcm_netdev_ops;
+/* tag_mtk.c */
+extern const struct dsa_device_ops mtk_netdev_ops;
 
 /* tag_qca.c */
 extern const struct dsa_device_ops qca_netdev_ops;
 
-/* tag_mtk.c */
-extern const struct dsa_device_ops mtk_netdev_ops;
-
-/* tag_lan9303.c */
-extern const struct dsa_device_ops lan9303_netdev_ops;
+/* tag_trailer.c */
+extern const struct dsa_device_ops trailer_netdev_ops;
 
 #endif