summaryrefslogtreecommitdiff
path: root/drivers/net/bonding/bond_sysfs.c
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@redhat.com>2014-01-22 14:53:23 +0100
committerDavid S. Miller <davem@davemloft.net>2014-01-22 15:38:42 -0800
commit7bdb04ed0dbf9f0e94110be43db4f8bb7df58de2 (patch)
tree32d3faa0349f33912923606058c082bcf712437d /drivers/net/bonding/bond_sysfs.c
parent1df6b6aa334c99b39f9366f4199b7f5e479a8899 (diff)
bonding: convert arp_interval to use the new option API
This patch adds the necessary changes so arp_interval would use the new bonding option API. The "default" definition has been removed as it was 0. 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, 2 insertions, 12 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 968c099945b2..585c38c5562c 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -436,22 +436,12 @@ static ssize_t bonding_store_arp_interval(struct device *d,
const char *buf, size_t count)
{
struct bonding *bond = to_bond(d);
- int new_value, ret;
-
- if (sscanf(buf, "%d", &new_value) != 1) {
- pr_err("%s: no arp_interval value specified.\n",
- bond->dev->name);
- return -EINVAL;
- }
-
- if (!rtnl_trylock())
- return restart_syscall();
+ int ret;
- ret = bond_option_arp_interval_set(bond, new_value);
+ ret = bond_opt_tryset_rtnl(bond, BOND_OPT_ARP_INTERVAL, (char *)buf);
if (!ret)
ret = count;
- rtnl_unlock();
return ret;
}
static DEVICE_ATTR(arp_interval, S_IRUGO | S_IWUSR,