summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_sysfs.c
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@redhat.com>2014-01-22 14:53:28 +0100
committerDavid S. Miller <davem@davemloft.net>2014-01-22 15:38:43 -0800
commit633ddc9e9bafd168861dee1000b2c6ff725e85c5 (patch)
tree39cbf28f3a4ead04ce544e94c9e24ab7668aafdb /drivers/net/bonding/bond_sysfs.c
parentd3131de76b1b1a4d95f145846bd61f96e72f0411 (diff)
downloadop-kernel-dev-633ddc9e9bafd168861dee1000b2c6ff725e85c5.zip
op-kernel-dev-633ddc9e9bafd168861dee1000b2c6ff725e85c5.tar.gz
bonding: convert min_links to use the new option API
This patch adds the necessary changes so min_links would use the new bonding option API. Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.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.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index a0a54d0..3ae9bfd 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -586,23 +586,11 @@ static ssize_t bonding_store_min_links(struct device *d,
{
struct bonding *bond = to_bond(d);
int ret;
- unsigned int new_value;
- ret = kstrtouint(buf, 0, &new_value);
- if (ret < 0) {
- pr_err("%s: Ignoring invalid min links value %s.\n",
- bond->dev->name, buf);
- return ret;
- }
-
- if (!rtnl_trylock())
- return restart_syscall();
-
- ret = bond_option_min_links_set(bond, new_value);
+ ret = bond_opt_tryset_rtnl(bond, BOND_OPT_MINLINKS, (char *)buf);
if (!ret)
ret = count;
- rtnl_unlock();
return ret;
}
static DEVICE_ATTR(min_links, S_IRUGO | S_IWUSR,
OpenPOWER on IntegriCloud