diff options
author | Doug Goldstein <cardoe@cardoe.com> | 2013-02-18 09:59:23 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-19 00:51:09 -0500 |
commit | b3f92b63c4c793142751d029ae0037fb8ab403a0 (patch) | |
tree | 3884e23988f44d3e22ec406b4fc06cb8825840d4 /drivers/net/bonding | |
parent | 0896341a44bf04bf6149d9307fe4686006f3eee1 (diff) |
bonding: set sysfs device_type to 'bond'
Sets the sysfs device_type to 'bond' for udev. This allows udev rules to
be created for bond devices. This is similar to how other network
devices set their device_type.
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index e242dd12e5a3..11d01d67b3f5 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -4264,6 +4264,10 @@ static const struct net_device_ops bond_netdev_ops = { | |||
4264 | .ndo_fix_features = bond_fix_features, | 4264 | .ndo_fix_features = bond_fix_features, |
4265 | }; | 4265 | }; |
4266 | 4266 | ||
4267 | static const struct device_type bond_type = { | ||
4268 | .name = "bond", | ||
4269 | }; | ||
4270 | |||
4267 | static void bond_destructor(struct net_device *bond_dev) | 4271 | static void bond_destructor(struct net_device *bond_dev) |
4268 | { | 4272 | { |
4269 | struct bonding *bond = netdev_priv(bond_dev); | 4273 | struct bonding *bond = netdev_priv(bond_dev); |
@@ -4294,6 +4298,8 @@ static void bond_setup(struct net_device *bond_dev) | |||
4294 | 4298 | ||
4295 | bond_dev->destructor = bond_destructor; | 4299 | bond_dev->destructor = bond_destructor; |
4296 | 4300 | ||
4301 | SET_NETDEV_DEVTYPE(bond_dev, &bond_type); | ||
4302 | |||
4297 | /* Initialize the device options */ | 4303 | /* Initialize the device options */ |
4298 | bond_dev->tx_queue_len = 0; | 4304 | bond_dev->tx_queue_len = 0; |
4299 | bond_dev->flags |= IFF_MASTER|IFF_MULTICAST; | 4305 | bond_dev->flags |= IFF_MASTER|IFF_MULTICAST; |