diff options
Diffstat (limited to 'drivers/net/bonding/bond_sysfs.c')
-rw-r--r-- | drivers/net/bonding/bond_sysfs.c | 22 |
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", |