@@ -130,18 +130,17 @@ qla2x00_initialize_adapter(scsi_qla_host_t *ha)
130
130
int
131
131
qla2100_pci_config (scsi_qla_host_t * ha )
132
132
{
133
- uint16_t w , mwi ;
133
+ int ret ;
134
+ uint16_t w ;
134
135
uint32_t d ;
135
136
unsigned long flags ;
136
137
struct device_reg_2xxx __iomem * reg = & ha -> iobase -> isp ;
137
138
138
139
pci_set_master (ha -> pdev );
139
- mwi = 0 ;
140
- if (pci_set_mwi (ha -> pdev ))
141
- mwi = PCI_COMMAND_INVALIDATE ;
140
+ ret = pci_set_mwi (ha -> pdev );
142
141
143
142
pci_read_config_word (ha -> pdev , PCI_COMMAND , & w );
144
- w |= mwi | (PCI_COMMAND_PARITY | PCI_COMMAND_SERR );
143
+ w |= (PCI_COMMAND_PARITY | PCI_COMMAND_SERR );
145
144
pci_write_config_word (ha -> pdev , PCI_COMMAND , w );
146
145
147
146
/* Reset expansion ROM address decode enable */
@@ -166,22 +165,22 @@ qla2100_pci_config(scsi_qla_host_t *ha)
166
165
int
167
166
qla2300_pci_config (scsi_qla_host_t * ha )
168
167
{
169
- uint16_t w , mwi ;
168
+ int ret ;
169
+ uint16_t w ;
170
170
uint32_t d ;
171
171
unsigned long flags = 0 ;
172
172
uint32_t cnt ;
173
173
struct device_reg_2xxx __iomem * reg = & ha -> iobase -> isp ;
174
174
175
175
pci_set_master (ha -> pdev );
176
- mwi = 0 ;
177
- if (pci_set_mwi (ha -> pdev ))
178
- mwi = PCI_COMMAND_INVALIDATE ;
176
+ ret = pci_set_mwi (ha -> pdev );
179
177
180
178
pci_read_config_word (ha -> pdev , PCI_COMMAND , & w );
181
- w |= mwi | (PCI_COMMAND_PARITY | PCI_COMMAND_SERR );
179
+ w |= (PCI_COMMAND_PARITY | PCI_COMMAND_SERR );
182
180
183
181
if (IS_QLA2322 (ha ) || IS_QLA6322 (ha ))
184
182
w &= ~PCI_COMMAND_INTX_DISABLE ;
183
+ pci_write_config_word (ha -> pdev , PCI_COMMAND , w );
185
184
186
185
/*
187
186
* If this is a 2300 card and not 2312, reset the
@@ -210,7 +209,7 @@ qla2300_pci_config(scsi_qla_host_t *ha)
210
209
ha -> fb_rev = RD_FB_CMD_REG (ha , reg );
211
210
212
211
if (ha -> fb_rev == FPM_2300 )
213
- w &= ~ PCI_COMMAND_INVALIDATE ;
212
+ pci_clear_mwi ( ha -> pdev ) ;
214
213
215
214
/* Deselect FPM registers. */
216
215
WRT_REG_WORD (& reg -> ctrl_status , 0x0 );
@@ -227,7 +226,6 @@ qla2300_pci_config(scsi_qla_host_t *ha)
227
226
228
227
spin_unlock_irqrestore (& ha -> hardware_lock , flags );
229
228
}
230
- pci_write_config_word (ha -> pdev , PCI_COMMAND , w );
231
229
232
230
pci_write_config_byte (ha -> pdev , PCI_LATENCY_TIMER , 0x80 );
233
231
@@ -253,19 +251,18 @@ qla2300_pci_config(scsi_qla_host_t *ha)
253
251
int
254
252
qla24xx_pci_config (scsi_qla_host_t * ha )
255
253
{
256
- uint16_t w , mwi ;
254
+ int ret ;
255
+ uint16_t w ;
257
256
uint32_t d ;
258
257
unsigned long flags = 0 ;
259
258
struct device_reg_24xx __iomem * reg = & ha -> iobase -> isp24 ;
260
259
int pcix_cmd_reg , pcie_dctl_reg ;
261
260
262
261
pci_set_master (ha -> pdev );
263
- mwi = 0 ;
264
- if (pci_set_mwi (ha -> pdev ))
265
- mwi = PCI_COMMAND_INVALIDATE ;
262
+ ret = pci_set_mwi (ha -> pdev );
266
263
267
264
pci_read_config_word (ha -> pdev , PCI_COMMAND , & w );
268
- w |= mwi | (PCI_COMMAND_PARITY | PCI_COMMAND_SERR );
265
+ w |= (PCI_COMMAND_PARITY | PCI_COMMAND_SERR );
269
266
w &= ~PCI_COMMAND_INTX_DISABLE ;
270
267
pci_write_config_word (ha -> pdev , PCI_COMMAND , w );
271
268
0 commit comments