diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2015-09-23 18:19:58 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-09-25 12:25:16 -0700 |
commit | f37db85d0c1eb6e4e8460cf7a13cfba42bfc2cb0 (patch) | |
tree | 887cfff0d67e4092ceea428ea483a9e0e7e0a0cc /net/dsa | |
parent | 4110b282059c6ddefe874b718756bbc3bc2db515 (diff) | |
download | lwn-f37db85d0c1eb6e4e8460cf7a13cfba42bfc2cb0.tar.gz lwn-f37db85d0c1eb6e4e8460cf7a13cfba42bfc2cb0.zip |
net: dsa: Set a "dsa" device_type
Provide a device_type information for slave network devices created by
DSA, this is useful for user-space application to easily locate/search
for devices of a specific kind.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/slave.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 71a11559b65f..f18cae54a5d8 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -961,6 +961,10 @@ static const struct switchdev_ops dsa_slave_switchdev_ops = { .switchdev_port_obj_dump = dsa_slave_port_obj_dump, }; +static struct device_type dsa_type = { + .name = "dsa", +}; + static void dsa_slave_adjust_link(struct net_device *dev) { struct dsa_slave_priv *p = netdev_priv(dev); @@ -1149,6 +1153,7 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent, slave_dev->priv_flags |= IFF_NO_QUEUE; slave_dev->netdev_ops = &dsa_slave_netdev_ops; slave_dev->switchdev_ops = &dsa_slave_switchdev_ops; + SET_NETDEV_DEVTYPE(slave_dev, &dsa_type); netdev_for_each_tx_queue(slave_dev, dsa_slave_set_lockdep_class_one, NULL); |