Skip to content

Commit 59f47ef

Browse files
robherringbjorn-helgaas
authored andcommitted
powerpc/pci: Use of_irq_parse_and_map_pci() helper
Instead of calling both of_irq_parse_pci() and irq_create_of_mapping(), call of_irq_parse_and_map_pci(), which does the same thing. This will allow making of_irq_parse_pci() a private, static function. This changes the logic slightly in that the fallback path will also be taken if irq_create_of_mapping() fails internally. Signed-off-by: Rob Herring <robh@kernel.org> [bhelgaas: fold in virq init from Stephen Rothwell <sfr@canb.auug.org.au>] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au>
1 parent 4670d61 commit 59f47ef

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

arch/powerpc/kernel/pci-common.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -339,16 +339,15 @@ struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node)
339339
*/
340340
static int pci_read_irq_line(struct pci_dev *pci_dev)
341341
{
342-
struct of_phandle_args oirq;
343-
unsigned int virq;
342+
unsigned int virq = 0;
344343

345344
pr_debug("PCI: Try to map irq for %s...\n", pci_name(pci_dev));
346345

347346
#ifdef DEBUG
348347
memset(&oirq, 0xff, sizeof(oirq));
349348
#endif
350349
/* Try to get a mapping from the device-tree */
351-
if (of_irq_parse_pci(pci_dev, &oirq)) {
350+
if (!of_irq_parse_and_map_pci(pci_dev, 0, 0)) {
352351
u8 line, pin;
353352

354353
/* If that fails, lets fallback to what is in the config
@@ -372,11 +371,6 @@ static int pci_read_irq_line(struct pci_dev *pci_dev)
372371
virq = irq_create_mapping(NULL, line);
373372
if (virq)
374373
irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
375-
} else {
376-
pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %pOF\n",
377-
oirq.args_count, oirq.args[0], oirq.args[1], oirq.np);
378-
379-
virq = irq_create_of_mapping(&oirq);
380374
}
381375

382376
if (!virq) {

0 commit comments

Comments
 (0)