summaryrefslogtreecommitdiff
path: root/net/core/rtnetlink.c
diff options
context:
space:
mode:
authorWilliams, Mitch A <mitch.a.williams@intel.com>2010-02-24 21:59:56 +0000
committerDavid S. Miller <davem@davemloft.net>2010-02-26 04:18:35 -0800
commit4edb246626be6e031950205c885bdf29fb2ff1eb (patch)
tree0bc82da3faff62d942c838f3bc020e1081ff9bfe /net/core/rtnetlink.c
parent914c8ad2d18b62ad1420f518c0cab0b0b90ab308 (diff)
rtnetlink: clean up SR-IOV config interface
This patch consists of a few minor cleanups to the SR-IOV configurion code in rtnetlink. - Remove unneccesary lock - Remove unneccesary casts - Return correct error code for no driver support These changes are based on comments from Patrick McHardy Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/rtnetlink.c')
-rw-r--r--net/core/rtnetlink.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 42da96a4eeee..4dd4c3cdc442 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -930,10 +930,9 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
if (tb[IFLA_VF_MAC]) {
struct ifla_vf_mac *ivm;
ivm = nla_data(tb[IFLA_VF_MAC]);
- write_lock_bh(&dev_base_lock);
+ err = -EOPNOTSUPP;
if (ops->ndo_set_vf_mac)
err = ops->ndo_set_vf_mac(dev, ivm->vf, ivm->mac);
- write_unlock_bh(&dev_base_lock);
if (err < 0)
goto errout;
modified = 1;
@@ -942,12 +941,11 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
if (tb[IFLA_VF_VLAN]) {
struct ifla_vf_vlan *ivv;
ivv = nla_data(tb[IFLA_VF_VLAN]);
- write_lock_bh(&dev_base_lock);
+ err = -EOPNOTSUPP;
if (ops->ndo_set_vf_vlan)
err = ops->ndo_set_vf_vlan(dev, ivv->vf,
- (u16)ivv->vlan,
- (u8)ivv->qos);
- write_unlock_bh(&dev_base_lock);
+ ivv->vlan,
+ ivv->qos);
if (err < 0)
goto errout;
modified = 1;
@@ -957,10 +955,9 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
if (tb[IFLA_VF_TX_RATE]) {
struct ifla_vf_tx_rate *ivt;
ivt = nla_data(tb[IFLA_VF_TX_RATE]);
- write_lock_bh(&dev_base_lock);
+ err = -EOPNOTSUPP;
if (ops->ndo_set_vf_tx_rate)
err = ops->ndo_set_vf_tx_rate(dev, ivt->vf, ivt->rate);
- write_unlock_bh(&dev_base_lock);
if (err < 0)
goto errout;
modified = 1;