@@ -166,6 +166,9 @@ static int pcie_init_service_irqs(struct pci_dev *dev, int *irqs, int mask)
166
166
{
167
167
int ret , i ;
168
168
169
+ for (i = 0 ; i < PCIE_PORT_DEVICE_MAXSERVICES ; i ++ )
170
+ irqs [i ] = -1 ;
171
+
169
172
/*
170
173
* If we support PME but can't use MSI/MSI-X for it, we have to
171
174
* fall back to INTx or other interrupts, e.g., a system shared
@@ -314,10 +317,8 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq)
314
317
*/
315
318
int pcie_port_device_register (struct pci_dev * dev )
316
319
{
317
- int status , capabilities , irq_services , i , nr_service ;
318
- int irqs [PCIE_PORT_DEVICE_MAXSERVICES ] = {
319
- [0 ... PCIE_PORT_DEVICE_MAXSERVICES - 1 ] = -1
320
- };
320
+ int status , capabilities , i , nr_service ;
321
+ int irqs [PCIE_PORT_DEVICE_MAXSERVICES ];
321
322
322
323
/* Enable PCI Express port device */
323
324
status = pci_enable_device (dev );
@@ -330,32 +331,18 @@ int pcie_port_device_register(struct pci_dev *dev)
330
331
return 0 ;
331
332
332
333
pci_set_master (dev );
333
-
334
- irq_services = 0 ;
335
- if (IS_ENABLED (CONFIG_PCIE_PME ))
336
- irq_services |= PCIE_PORT_SERVICE_PME ;
337
- if (IS_ENABLED (CONFIG_PCIEAER ))
338
- irq_services |= PCIE_PORT_SERVICE_AER ;
339
- if (IS_ENABLED (CONFIG_HOTPLUG_PCI_PCIE ))
340
- irq_services |= PCIE_PORT_SERVICE_HP ;
341
- if (IS_ENABLED (CONFIG_PCIE_DPC ))
342
- irq_services |= PCIE_PORT_SERVICE_DPC ;
343
- irq_services &= capabilities ;
344
-
345
- if (irq_services ) {
346
- /*
347
- * Initialize service IRQs. Don't use service devices that
348
- * require interrupts if there is no way to generate them.
349
- * However, some drivers may have a polling mode (e.g.
350
- * pciehp_poll_mode) that can be used in the absence of IRQs.
351
- * Allow them to determine if that is to be used.
352
- */
353
- status = pcie_init_service_irqs (dev , irqs , irq_services );
354
- if (status ) {
355
- irq_services &= PCIE_PORT_SERVICE_HP ;
356
- if (!irq_services )
357
- goto error_disable ;
358
- }
334
+ /*
335
+ * Initialize service irqs. Don't use service devices that
336
+ * require interrupts if there is no way to generate them.
337
+ * However, some drivers may have a polling mode (e.g. pciehp_poll_mode)
338
+ * that can be used in the absence of irqs. Allow them to determine
339
+ * if that is to be used.
340
+ */
341
+ status = pcie_init_service_irqs (dev , irqs , capabilities );
342
+ if (status ) {
343
+ capabilities &= PCIE_PORT_SERVICE_HP ;
344
+ if (!capabilities )
345
+ goto error_disable ;
359
346
}
360
347
361
348
/* Allocate child services if any */
0 commit comments