aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGovindarajulu Varadarajan <_govind@gmx.com>2014-06-23 06:37:59 -0400
committerDavid S. Miller <davem@davemloft.net>2014-06-23 17:32:19 -0400
commit10cc88446cec4eee8e2efab24ad387d52ef1f4fb (patch)
treeeff9e24156cad2aa7286ebc4a753e5c50b710045
parente0f31d8498676fda36289603a054d0d490aa2679 (diff)
enic: fix return value in _vnic_dev_cmd
Hardware (in readq(&devcmd->args[0])) returns positive number in case of error. But _vnic_dev_cmd should return a negative value in case of error. Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/cisco/enic/vnic_dev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/cisco/enic/vnic_dev.c b/drivers/net/ethernet/cisco/enic/vnic_dev.c
index e86a45cb9e68..263081b8e636 100644
--- a/drivers/net/ethernet/cisco/enic/vnic_dev.c
+++ b/drivers/net/ethernet/cisco/enic/vnic_dev.c
@@ -312,12 +312,12 @@ static int _vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd,
312 err = (int)readq(&devcmd->args[0]); 312 err = (int)readq(&devcmd->args[0]);
313 if (err == ERR_EINVAL && 313 if (err == ERR_EINVAL &&
314 cmd == CMD_CAPABILITY) 314 cmd == CMD_CAPABILITY)
315 return err; 315 return -err;
316 if (err != ERR_ECMDUNKNOWN || 316 if (err != ERR_ECMDUNKNOWN ||
317 cmd != CMD_CAPABILITY) 317 cmd != CMD_CAPABILITY)
318 pr_err("Error %d devcmd %d\n", 318 pr_err("Error %d devcmd %d\n",
319 err, _CMD_N(cmd)); 319 err, _CMD_N(cmd));
320 return err; 320 return -err;
321 } 321 }
322 322
323 if (_CMD_DIR(cmd) & _CMD_DIR_READ) { 323 if (_CMD_DIR(cmd) & _CMD_DIR_READ) {