@@ -218,6 +218,27 @@ static void pm8001_tasklet(unsigned long opaque)
218
218
BUG_ON (1 );
219
219
PM8001_CHIP_DISP -> isr (pm8001_ha , irq_vector -> irq_id );
220
220
}
221
+
222
+ static void pm8001_init_tasklet (struct pm8001_hba_info * pm8001_ha )
223
+ {
224
+ int i ;
225
+
226
+ /* Tasklet for non msi-x interrupt handler */
227
+ if ((!pm8001_ha -> pdev -> msix_cap || !pci_msi_enabled ()) ||
228
+ (pm8001_ha -> chip_id == chip_8001 )) {
229
+ tasklet_init (& pm8001_ha -> tasklet [0 ], pm8001_tasklet ,
230
+ (unsigned long )& (pm8001_ha -> irq_vector [0 ]));
231
+ return ;
232
+ }
233
+ for (i = 0 ; i < PM8001_MAX_MSIX_VEC ; i ++ )
234
+ tasklet_init (& pm8001_ha -> tasklet [i ], pm8001_tasklet ,
235
+ (unsigned long )& (pm8001_ha -> irq_vector [i ]));
236
+ }
237
+
238
+ #else
239
+
240
+ static void pm8001_init_tasklet (struct pm8001_hba_info * pm8001_ha ) {}
241
+
221
242
#endif
222
243
223
244
/**
@@ -512,7 +533,6 @@ static struct pm8001_hba_info *pm8001_pci_alloc(struct pci_dev *pdev,
512
533
{
513
534
struct pm8001_hba_info * pm8001_ha ;
514
535
struct sas_ha_struct * sha = SHOST_TO_SAS_HA (shost );
515
- int j ;
516
536
517
537
pm8001_ha = sha -> lldd_ha ;
518
538
if (!pm8001_ha )
@@ -543,17 +563,8 @@ static struct pm8001_hba_info *pm8001_pci_alloc(struct pci_dev *pdev,
543
563
else
544
564
pm8001_ha -> iomb_size = IOMB_SIZE_SPC ;
545
565
546
- #ifdef PM8001_USE_TASKLET
547
- /* Tasklet for non msi-x interrupt handler */
548
- if ((!pdev -> msix_cap || !pci_msi_enabled ())
549
- || (pm8001_ha -> chip_id == chip_8001 ))
550
- tasklet_init (& pm8001_ha -> tasklet [0 ], pm8001_tasklet ,
551
- (unsigned long )& (pm8001_ha -> irq_vector [0 ]));
552
- else
553
- for (j = 0 ; j < PM8001_MAX_MSIX_VEC ; j ++ )
554
- tasklet_init (& pm8001_ha -> tasklet [j ], pm8001_tasklet ,
555
- (unsigned long )& (pm8001_ha -> irq_vector [j ]));
556
- #endif
566
+ pm8001_init_tasklet (pm8001_ha );
567
+
557
568
if (pm8001_ioremap (pm8001_ha ))
558
569
goto failed_pci_alloc ;
559
570
if (!pm8001_alloc (pm8001_ha , ent ))
@@ -1362,7 +1373,7 @@ static int __maybe_unused pm8001_pci_resume(struct device *dev)
1362
1373
struct sas_ha_struct * sha = pci_get_drvdata (pdev );
1363
1374
struct pm8001_hba_info * pm8001_ha ;
1364
1375
int rc ;
1365
- u8 i = 0 , j ;
1376
+ u8 i = 0 ;
1366
1377
DECLARE_COMPLETION_ONSTACK (completion );
1367
1378
1368
1379
pm8001_ha = sha -> lldd_ha ;
@@ -1390,17 +1401,9 @@ static int __maybe_unused pm8001_pci_resume(struct device *dev)
1390
1401
rc = pm8001_request_irq (pm8001_ha );
1391
1402
if (rc )
1392
1403
goto err_out_disable ;
1393
- #ifdef PM8001_USE_TASKLET
1394
- /* Tasklet for non msi-x interrupt handler */
1395
- if ((!pdev -> msix_cap || !pci_msi_enabled ()) ||
1396
- (pm8001_ha -> chip_id == chip_8001 ))
1397
- tasklet_init (& pm8001_ha -> tasklet [0 ], pm8001_tasklet ,
1398
- (unsigned long )& (pm8001_ha -> irq_vector [0 ]));
1399
- else
1400
- for (j = 0 ; j < PM8001_MAX_MSIX_VEC ; j ++ )
1401
- tasklet_init (& pm8001_ha -> tasklet [j ], pm8001_tasklet ,
1402
- (unsigned long )& (pm8001_ha -> irq_vector [j ]));
1403
- #endif
1404
+
1405
+ pm8001_init_tasklet (pm8001_ha );
1406
+
1404
1407
PM8001_CHIP_DISP -> interrupt_enable (pm8001_ha , 0 );
1405
1408
if (pm8001_ha -> chip_id != chip_8001 ) {
1406
1409
for (i = 1 ; i < pm8001_ha -> number_of_intr ; i ++ )
0 commit comments