Commit 709eb0f9 authored by Anton Blanchard's avatar Anton Blanchard

ppc64: move pci_device_to_OF_node so radeonfb can get at it

parent 7641031c
......@@ -64,23 +64,6 @@ void iSeries_pcibios_init_early(void);
void pSeries_pcibios_init_early(void);
void pSeries_pcibios_init(void);
/* Get a device_node from a pci_dev. This code must be fast except in the case
* where the sysdata is incorrect and needs to be fixed up (hopefully just once)
*/
static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev)
{
struct device_node *dn = (struct device_node *)(dev->sysdata);
if (dn->devfn == dev->devfn && dn->busno == dev->bus->number)
return dn; /* fast path. sysdata is good */
else
return fetch_dev_dn(dev);
}
/* Use this macro after the PCI bus walk for max performance when it
* is known that sysdata is correct.
*/
#define PCI_GET_DN(dev) ((struct device_node *)((dev)->sysdata))
/*******************************************************************
* Platform configuration flags.. (Live in pci.c)
*******************************************************************/
......
......@@ -79,5 +79,23 @@ struct pci_controller {
int pci_device_loc(struct device_node *dev, unsigned char *bus_ptr,
unsigned char *devfn_ptr);
struct device_node *fetch_dev_dn(struct pci_dev *dev);
/* Get a device_node from a pci_dev. This code must be fast except in the case
* where the sysdata is incorrect and needs to be fixed up (hopefully just once)
*/
static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev)
{
struct device_node *dn = (struct device_node *)(dev->sysdata);
if (dn->devfn == dev->devfn && dn->busno == dev->bus->number)
return dn; /* fast path. sysdata is good */
else
return fetch_dev_dn(dev);
}
/* Use this macro after the PCI bus walk for max performance when it
* is known that sysdata is correct.
*/
#define PCI_GET_DN(dev) ((struct device_node *)((dev)->sysdata))
#endif
#endif /* __KERNEL__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment