File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
drivers/net/ethernet/qlogic/qlcnic Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -187,20 +187,24 @@ int qlcnic_83xx_config_vnic_opmode(struct qlcnic_adapter *adapter)
187
187
else
188
188
priv_level = QLC_83XX_GET_FUNC_PRIVILEGE (op_mode ,
189
189
ahw -> pci_func );
190
-
191
- if ( priv_level == QLCNIC_NON_PRIV_FUNC ) {
190
+ switch ( priv_level ) {
191
+ case QLCNIC_NON_PRIV_FUNC :
192
192
ahw -> op_mode = QLCNIC_NON_PRIV_FUNC ;
193
193
ahw -> idc .state_entry = qlcnic_83xx_idc_ready_state_entry ;
194
194
nic_ops -> init_driver = qlcnic_83xx_init_non_privileged_vnic ;
195
- } else if (priv_level == QLCNIC_PRIV_FUNC ) {
195
+ break ;
196
+ case QLCNIC_PRIV_FUNC :
196
197
ahw -> op_mode = QLCNIC_PRIV_FUNC ;
197
198
ahw -> idc .state_entry = qlcnic_83xx_idc_vnic_pf_entry ;
198
199
nic_ops -> init_driver = qlcnic_83xx_init_privileged_vnic ;
199
- } else if (priv_level == QLCNIC_MGMT_FUNC ) {
200
+ break ;
201
+ case QLCNIC_MGMT_FUNC :
200
202
ahw -> op_mode = QLCNIC_MGMT_FUNC ;
201
203
ahw -> idc .state_entry = qlcnic_83xx_idc_ready_state_entry ;
202
204
nic_ops -> init_driver = qlcnic_83xx_init_mgmt_vnic ;
203
- } else {
205
+ break ;
206
+ default :
207
+ dev_err (& adapter -> pdev -> dev , "Invalid Virtual NIC opmode\n" );
204
208
return - EIO ;
205
209
}
206
210
@@ -209,8 +213,8 @@ int qlcnic_83xx_config_vnic_opmode(struct qlcnic_adapter *adapter)
209
213
else
210
214
adapter -> flags &= ~QLCNIC_ESWITCH_ENABLED ;
211
215
212
- adapter -> ahw -> idc .vnic_state = QLCNIC_DEV_NPAR_NON_OPER ;
213
- adapter -> ahw -> idc .vnic_wait_limit = QLCNIC_DEV_NPAR_OPER_TIMEO ;
216
+ ahw -> idc .vnic_state = QLCNIC_DEV_NPAR_NON_OPER ;
217
+ ahw -> idc .vnic_wait_limit = QLCNIC_DEV_NPAR_OPER_TIMEO ;
214
218
215
219
return 0 ;
216
220
}
You can’t perform that action at this time.
0 commit comments