aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Rustad <mark.d.rustad@intel.com>2014-07-22 02:50:52 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-07-25 22:26:44 -0400
commit4e86281b59ce7881cc21dfb6fb4b596f737d6ee5 (patch)
treef50ba1f3e24bec7262ee70668fb10c2e808eb1c4
parentacb1ce223b3e6a340e46fe7b21a9dd4797618ace (diff)
ixgbe: Fix ixgbe_write_mbx error result
If ixgbe_write_mbx is called and no mbx->ops.write method exists, no error code is returned. The corresponding read function explicitly returns an error in such a case as do other functions, so this appears to be a minor bug. Fix it for consistency, and generate return values directly to make things clearer. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c
index 1918e0abf734..50479575e131 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 Intel 10 Gigabit PCI Express Linux driver 3 Intel 10 Gigabit PCI Express Linux driver
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 Copyright(c) 1999 - 2014 Intel Corporation.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License, 7 under the terms and conditions of the GNU General Public License,
@@ -67,15 +67,14 @@ s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
67s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) 67s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
68{ 68{
69 struct ixgbe_mbx_info *mbx = &hw->mbx; 69 struct ixgbe_mbx_info *mbx = &hw->mbx;
70 s32 ret_val = 0;
71 70
72 if (size > mbx->size) 71 if (size > mbx->size)
73 ret_val = IXGBE_ERR_MBX; 72 return IXGBE_ERR_MBX;
74 73
75 else if (mbx->ops.write) 74 if (!mbx->ops.write)
76 ret_val = mbx->ops.write(hw, msg, size, mbx_id); 75 return IXGBE_ERR_MBX;
77 76
78 return ret_val; 77 return mbx->ops.write(hw, msg, size, mbx_id);
79} 78}
80 79
81/** 80/**