]> Pileus Git - ~andy/linux/blobdiff - drivers/net/bonding/bond_sysfs.c
bonding: convert arp_interval to use the new option API
[~andy/linux] / drivers / net / bonding / bond_sysfs.c
index 968c099945b2b562bdaa187dd5421f3c5dc4e55f..585c38c5562c63fa511c0dbc787f32e2ab09f1b1 100644 (file)
@@ -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,