summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_sysfs.c
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@redhat.com>2014-01-22 14:53:30 +0100
committerDavid S. Miller <davem@davemloft.net>2014-01-22 15:38:43 -0800
commitef56becbb37251f0371ad94210f50dc90e18830a (patch)
treed657b18b30389725142a2df35c8ba2ddefaae636 /drivers/net/bonding/bond_sysfs.c
parent9e5f5eebe765b340af0318dba261e5de0f2aaf32 (diff)
downloadlinux-ef56becbb37251f0371ad94210f50dc90e18830a.tar.gz
linux-ef56becbb37251f0371ad94210f50dc90e18830a.tar.bz2
linux-ef56becbb37251f0371ad94210f50dc90e18830a.zip
bonding: convert num_peer_notif to use the new option API
This patch adds the necessary changes so num_peer_notif would use the new bonding option API. When the auto-sysfs generation is done an alias should be added for this option as there're currently 2 entries in sysfs for it. 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 02e493ae5173..e1c99db134a9 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -641,24 +641,12 @@ static ssize_t bonding_store_num_peer_notif(struct device *d,
const char *buf, size_t count)
{
struct bonding *bond = to_bond(d);
- u8 new_value;
int ret;
- ret = kstrtou8(buf, 10, &new_value);
- if (ret) {
- pr_err("%s: invalid value %s specified.\n",
- bond->dev->name, buf);
- return ret;
- }
-
- if (!rtnl_trylock())
- return restart_syscall();
-
- ret = bond_option_num_peer_notif_set(bond, new_value);
+ ret = bond_opt_tryset_rtnl(bond, BOND_OPT_NUM_PEER_NOTIF, (char *)buf);
if (!ret)
ret = count;
- rtnl_unlock();
return ret;
}
static DEVICE_ATTR(num_grat_arp, S_IRUGO | S_IWUSR,