Commit 4e86281b authored by Mark Rustad's avatar Mark Rustad Committed by Jeff Kirsher

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: default avatarMark Rustad <mark.d.rustad@intel.com>
Tested-by: default avatarPhil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent acb1ce22
/******************************************************************************* /*******************************************************************************
Intel 10 Gigabit PCI Express Linux driver Intel 10 Gigabit PCI Express Linux driver
Copyright(c) 1999 - 2013 Intel Corporation. Copyright(c) 1999 - 2014 Intel Corporation.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License, 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) ...@@ -67,15 +67,14 @@ s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
{ {
struct ixgbe_mbx_info *mbx = &hw->mbx; struct ixgbe_mbx_info *mbx = &hw->mbx;
s32 ret_val = 0;
if (size > mbx->size) if (size > mbx->size)
ret_val = IXGBE_ERR_MBX; return IXGBE_ERR_MBX;
else if (mbx->ops.write) if (!mbx->ops.write)
ret_val = mbx->ops.write(hw, msg, size, mbx_id); return IXGBE_ERR_MBX;
return ret_val; return mbx->ops.write(hw, msg, size, mbx_id);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment