Skip to content

Commit

Permalink
bonding: set sysfs device_type to 'bond'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Doug Goldstein authored and David S. Miller committed Feb 19, 2013
1 parent 0896341 commit b3f92b6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4264,6 +4264,10 @@ static const struct net_device_ops bond_netdev_ops = {
.ndo_fix_features = bond_fix_features,
};

static const struct device_type bond_type = {
.name = "bond",
};

static void bond_destructor(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
Expand Down Expand Up @@ -4294,6 +4298,8 @@ static void bond_setup(struct net_device *bond_dev)

bond_dev->destructor = bond_destructor;

SET_NETDEV_DEVTYPE(bond_dev, &bond_type);

/* Initialize the device options */
bond_dev->tx_queue_len = 0;
bond_dev->flags |= IFF_MASTER|IFF_MULTICAST;
Expand Down

0 comments on commit b3f92b6

Please sign in to comment.