diff options
author | Andrew Lunn | 2019-04-28 19:37:15 +0200 |
---|---|---|
committer | David S. Miller | 2019-04-29 01:41:01 +0200 |
commit | d3b8c04988ca1685700e345a82a1396df79e6291 (patch) | |
tree | 382a5a63a483f39027496510da8404a90878bdb9 /net/dsa/tag_ksz.c | |
parent | dsa: Add TAG protocol to tag ops (diff) | |
download | kernel-qcow2-linux-d3b8c04988ca1685700e345a82a1396df79e6291.tar.gz kernel-qcow2-linux-d3b8c04988ca1685700e345a82a1396df79e6291.tar.xz kernel-qcow2-linux-d3b8c04988ca1685700e345a82a1396df79e6291.zip |
dsa: Add boilerplate helper to register DSA tag driver modules
A DSA tag driver module will need to register the tag protocols it
implements with the DSA core. Add macros containing this boiler plate.
The registration/unregistration code is currently just a stub. A Later
patch will add the real implementation.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
v2
Fix indent of #endif
Rewrite to move list pointer into a new structure
v3
Move kdoc next to macro
Fix THIS_MODULE indentation
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/tag_ksz.c')
-rw-r--r-- | net/dsa/tag_ksz.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c index 5f5c8f9a6141..02689ac6f9da 100644 --- a/net/dsa/tag_ksz.c +++ b/net/dsa/tag_ksz.c @@ -141,6 +141,7 @@ const struct dsa_device_ops ksz9477_netdev_ops = { .overhead = KSZ9477_INGRESS_TAG_LEN, }; +DSA_TAG_DRIVER(ksz9477_netdev_ops); MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_KSZ9477); #define KSZ9893_TAIL_TAG_OVERRIDE BIT(5) @@ -178,5 +179,14 @@ const struct dsa_device_ops ksz9893_netdev_ops = { .overhead = KSZ_INGRESS_TAG_LEN, }; -MODULE_LICENSE("GPL"); +DSA_TAG_DRIVER(ksz9893_netdev_ops); MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_KSZ9893); + +static struct dsa_tag_driver *dsa_tag_driver_array[] = { + &DSA_TAG_DRIVER_NAME(ksz9477_netdev_ops), + &DSA_TAG_DRIVER_NAME(ksz9893_netdev_ops), +}; + +module_dsa_tag_drivers(dsa_tag_driver_array); + +MODULE_LICENSE("GPL"); |