Skip to contentSkip to conversation

bonding: set sysfs device_type to 'bond'

PATCH Superseded Doug Goldstein 2 participants 4 messages Feb 18, 2013 – Feb 19, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/bonding/bond_main.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/bonding/bond_main.c +6 -0
index b7d45f3..34a6e96 100644
@@ -4350,6 +4350,10 @@ static const struct net_device_ops bond_netdev_ops = {
 	.ndo_add_slave		= bond_enslave,
 	.ndo_del_slave		= bond_release,
 	.ndo_fix_features	= bond_fix_features,
+}; 
+
+static const struct device_type bond_type = {
+	.name = "bond",
 };
 
 static void bond_destructor(struct net_device *bond_dev)
@@ -4382,6 +4386,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;
Signature · 1 line
1.7.12.4
maintainer
#1 lore raw

From: Doug Goldstein <[email protected]>
Date: Sun, 17 Feb 2013 20:38:47 -0600

drivers/net/bonding/bond_main.c static const struct net_device_ops bond_netdev_ops = { · line 4353

Quoted 5 lines
drivers/net/bonding/bond_main.c +1 -0
@@ -4350,6 +4350,10 @@ static const struct net_device_ops bond_netdev_ops = {
 	.ndo_add_slave		= bond_enslave,
 	.ndo_del_slave		= bond_release,
 	.ndo_fix_features	= bond_fix_features,
+}; 
     ^^

There is trailing whitespace there, please get rid of it.

Thanks.

#2 lore raw

PATCH v2 1/1 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.

---
v2: removed accidental whitespace addition

---
 drivers/net/bonding/bond_main.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/bonding/bond_main.c +6 -0
index b7d45f3..876505f 100644
@@ -4352,6 +4352,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);
@@ -4382,6 +4386,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;
Signature · 1 line
1.7.12.4
maintainer Applied
#3 lore raw

From: Doug Goldstein <[email protected]>
Date: Mon, 18 Feb 2013 18:59:23 -0600

Quoted 5 lines

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.

Applied.