Skip to content

Commit

Permalink
[SPARC]: Provide pci_device_to_OF_node() just like powerpc.
Browse files Browse the repository at this point in the history
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
David S. Miller committed Mar 2, 2007
1 parent 45bcca6 commit f6d0f9e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/sparc/kernel/pcic.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,14 @@ int pcibios_assign_resource(struct pci_dev *pdev, int resource)
return -ENXIO;
}

struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
{
struct pcidev_cookie *pc = pdev->sysdata;

return pc->prom_node;
}
EXPORT_SYMBOL(pci_device_to_OF_node);

/*
* This probably belongs here rather than ioport.c because
* we do not want this crud linked into SBus kernels.
Expand Down
8 changes: 8 additions & 0 deletions arch/sparc64/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,4 +681,12 @@ void arch_teardown_msi_irq(unsigned int virt_irq)
}
#endif /* !(CONFIG_PCI_MSI) */

struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
{
struct pcidev_cookie *pc = pdev->sysdata;

return pc->op->node;
}
EXPORT_SYMBOL(pci_device_to_OF_node);

#endif /* !(CONFIG_PCI) */
3 changes: 3 additions & 0 deletions include/asm-sparc/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ static inline int pci_dma_mapping_error(dma_addr_t dma_addr)
return (dma_addr == PCI_DMA_ERROR_CODE);
}

struct device_node;
extern struct device_node *pci_device_to_OF_node(struct pci_dev *pdev);

#endif /* __KERNEL__ */

/* generic pci stuff */
Expand Down
3 changes: 3 additions & 0 deletions include/asm-sparc64/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
return PCI_IRQ_NONE;
}

struct device_node;
extern struct device_node *pci_device_to_OF_node(struct pci_dev *pdev);

#endif /* __KERNEL__ */

#endif /* __SPARC64_PCI_H */

0 comments on commit f6d0f9e

Please sign in to comment.