[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1288318786-12319-7-git-send-email-jon.mason@exar.com>
Date: Thu, 28 Oct 2010 21:19:42 -0500
From: Jon Mason <jon.mason@...r.com>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org,
Sivakumar Subramani <sivakumar.subramani@...r.com>,
Sreenivasa Honnur <sreenivasa.honnur@...r.com>,
Ram Vepa <ram.vepa@...r.com>
Subject: [PATCH 07/11] vxge: Handle errors in vxge_hw_vpath_fw_api
Propagate the return code of the call to vxge_hw_vpath_fw_api and
__vxge_hw_vpath_pci_func_mode_get. This enables the proper handling of
error conditions when querying the function mode of the device during
probe.
Signed-off-by: Jon Mason <jon.mason@...r.com>
Signed-off-by: Ram Vepa <ram.vepa@...r.com>
---
drivers/net/vxge/vxge-config.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/net/vxge/vxge-config.c b/drivers/net/vxge/vxge-config.c
index 4a166a3..e18b2f9 100644
--- a/drivers/net/vxge/vxge-config.c
+++ b/drivers/net/vxge/vxge-config.c
@@ -958,8 +958,9 @@ __vxge_hw_vpath_card_info_get(struct __vxge_hw_virtualpath *vpath,
* __vxge_hw_vpath_pci_func_mode_get - Get the pci mode
* Returns pci function mode
*/
-static u64
-__vxge_hw_vpath_pci_func_mode_get(struct __vxge_hw_virtualpath *vpath)
+static enum vxge_hw_status
+__vxge_hw_vpath_pci_func_mode_get(struct __vxge_hw_virtualpath *vpath,
+ struct vxge_hw_device_hw_info *hw_info)
{
u64 data0, data1 = 0, steer_ctrl = 0;
enum vxge_hw_status status;
@@ -970,8 +971,11 @@ __vxge_hw_vpath_pci_func_mode_get(struct __vxge_hw_virtualpath *vpath)
VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION_READ_MEMO_ENTRY,
VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_FW_MEMO,
0, &data0, &data1, &steer_ctrl);
+ if (status != VXGE_HW_OK)
+ return status;
- return data0;
+ hw_info->function_mode = data0;
+ return status;
}
/*
@@ -1086,8 +1090,9 @@ vxge_hw_device_hw_info_get(void __iomem *bar0,
(bar0 + val64);
vpath.vp_open = 0;
- hw_info->function_mode =
- __vxge_hw_vpath_pci_func_mode_get(&vpath);
+ status = __vxge_hw_vpath_pci_func_mode_get(&vpath, hw_info);
+ if (status != VXGE_HW_OK)
+ goto exit;
status = __vxge_hw_vpath_fw_ver_get(&vpath, hw_info);
if (status != VXGE_HW_OK)
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists