aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_sysfs.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-11-20 00:56:05 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-20 01:42:42 -0500
commiteb7cc59a038b4e1914ae991d313f35904924759f (patch)
tree4f4af2bd1e4e86582b45e9ce18ca88fcff287665 /drivers/net/bonding/bond_sysfs.c
parent656299f706e52e0409733d704c2761f1b12d6954 (diff)
bonding: convert to net_device_ops
Convert to net_device_ops table. Note: for some operations move error checking into generic networking layer (rather than looking at pointers in bonding). A couple of gratituous style cleanups to get rid of extra {} Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_sysfs.c')
-rw-r--r--drivers/net/bonding/bond_sysfs.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index fc490d89d4af..f6475ce347df 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -317,18 +317,12 @@ static ssize_t bonding_store_slaves(struct device *d,
317 317
318 /* Set the slave's MTU to match the bond */ 318 /* Set the slave's MTU to match the bond */
319 original_mtu = dev->mtu; 319 original_mtu = dev->mtu;
320 if (dev->mtu != bond->dev->mtu) { 320 res = dev_set_mtu(dev, bond->dev->mtu);
321 if (dev->change_mtu) { 321 if (res) {
322 res = dev->change_mtu(dev, 322 ret = res;
323 bond->dev->mtu); 323 goto out;
324 if (res) {
325 ret = res;
326 goto out;
327 }
328 } else {
329 dev->mtu = bond->dev->mtu;
330 }
331 } 324 }
325
332 res = bond_enslave(bond->dev, dev); 326 res = bond_enslave(bond->dev, dev);
333 bond_for_each_slave(bond, slave, i) 327 bond_for_each_slave(bond, slave, i)
334 if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0) 328 if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0)
@@ -357,11 +351,7 @@ static ssize_t bonding_store_slaves(struct device *d,
357 goto out; 351 goto out;
358 } 352 }
359 /* set the slave MTU to the default */ 353 /* set the slave MTU to the default */
360 if (dev->change_mtu) { 354 dev_set_mtu(dev, original_mtu);
361 dev->change_mtu(dev, original_mtu);
362 } else {
363 dev->mtu = original_mtu;
364 }
365 } 355 }
366 else { 356 else {
367 printk(KERN_ERR DRV_NAME ": unable to remove non-existent slave %s for bond %s.\n", 357 printk(KERN_ERR DRV_NAME ": unable to remove non-existent slave %s for bond %s.\n",