Patchwork bonding: set sysfs device_type to 'bond'

login
register
mail settings
Submitter Doug Goldstein
Date Feb. 18, 2013, 2:38 a.m.
Message ID <1361155127-4415-1-git-send-email-cardoe@cardoe.com>
Download mbox | patch
Permalink /patch/221136/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Doug Goldstein - Feb. 18, 2013, 2:38 a.m.
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>
---
 drivers/net/bonding/bond_main.c | 6 ++++++
 1 file changed, 6 insertions(+)
David Miller - Feb. 18, 2013, 7:49 p.m.
From: Doug Goldstein <cardoe@cardoe.com>
Date: Sun, 17 Feb 2013 20:38:47 -0600

> @@ -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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index b7d45f3..34a6e96 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -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;