diff options
author | Jon Mason <jon.mason@exar.com> | 2010-11-10 23:25:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-11 12:30:22 -0500 |
commit | c3150eac9f2e5f770b09d371f7716540219a46f6 (patch) | |
tree | d4c47c29ec4f5c904fbd125e105ba816ec0cc792 | |
parent | b81b37338412e3215670641e5025c85146521dea (diff) |
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@exar.com>
Signed-off-by: Ram Vepa <ram.vepa@exar.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | 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 7761b9e0ad84..388e6c48696b 100644 --- a/drivers/net/vxge/vxge-config.c +++ b/drivers/net/vxge/vxge-config.c | |||
@@ -1107,8 +1107,9 @@ __vxge_hw_vpath_card_info_get(struct __vxge_hw_virtualpath *vpath, | |||
1107 | * __vxge_hw_vpath_pci_func_mode_get - Get the pci mode | 1107 | * __vxge_hw_vpath_pci_func_mode_get - Get the pci mode |
1108 | * Returns pci function mode | 1108 | * Returns pci function mode |
1109 | */ | 1109 | */ |
1110 | static u64 | 1110 | static enum vxge_hw_status |
1111 | __vxge_hw_vpath_pci_func_mode_get(struct __vxge_hw_virtualpath *vpath) | 1111 | __vxge_hw_vpath_pci_func_mode_get(struct __vxge_hw_virtualpath *vpath, |
1112 | struct vxge_hw_device_hw_info *hw_info) | ||
1112 | { | 1113 | { |
1113 | u64 data0, data1 = 0, steer_ctrl = 0; | 1114 | u64 data0, data1 = 0, steer_ctrl = 0; |
1114 | enum vxge_hw_status status; | 1115 | enum vxge_hw_status status; |
@@ -1119,8 +1120,11 @@ __vxge_hw_vpath_pci_func_mode_get(struct __vxge_hw_virtualpath *vpath) | |||
1119 | VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION_READ_MEMO_ENTRY, | 1120 | VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION_READ_MEMO_ENTRY, |
1120 | VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_FW_MEMO, | 1121 | VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_FW_MEMO, |
1121 | 0, &data0, &data1, &steer_ctrl); | 1122 | 0, &data0, &data1, &steer_ctrl); |
1123 | if (status != VXGE_HW_OK) | ||
1124 | return status; | ||
1122 | 1125 | ||
1123 | return data0; | 1126 | hw_info->function_mode = data0; |
1127 | return status; | ||
1124 | } | 1128 | } |
1125 | 1129 | ||
1126 | /* | 1130 | /* |
@@ -1235,8 +1239,9 @@ vxge_hw_device_hw_info_get(void __iomem *bar0, | |||
1235 | (bar0 + val64); | 1239 | (bar0 + val64); |
1236 | vpath.vp_open = 0; | 1240 | vpath.vp_open = 0; |
1237 | 1241 | ||
1238 | hw_info->function_mode = | 1242 | status = __vxge_hw_vpath_pci_func_mode_get(&vpath, hw_info); |
1239 | __vxge_hw_vpath_pci_func_mode_get(&vpath); | 1243 | if (status != VXGE_HW_OK) |
1244 | goto exit; | ||
1240 | 1245 | ||
1241 | status = __vxge_hw_vpath_fw_ver_get(&vpath, hw_info); | 1246 | status = __vxge_hw_vpath_fw_ver_get(&vpath, hw_info); |
1242 | if (status != VXGE_HW_OK) | 1247 | if (status != VXGE_HW_OK) |