From: Kenji Kaneshige > Can we please uninline this? > OK. Here is an updated one. Signed-off-by: Kenji Kaneshige Cc: Greg KH Cc: James Smart Cc: James Bottomley Cc: John Ronciak Cc: Jesse Brandeburg Cc: Jeff Kirsher Signed-off-by: Andrew Morton --- drivers/pci/pci.c | 17 +++++++++++++++++ include/linux/pci.h | 12 +----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff -puN drivers/pci/pci.c~pci-legacy-i-o-port-free-driver-changes-to-generic-pci-code-fix drivers/pci/pci.c --- devel/drivers/pci/pci.c~pci-legacy-i-o-port-free-driver-changes-to-generic-pci-code-fix 2006-03-26 21:56:51.000000000 -0800 +++ devel-akpm/drivers/pci/pci.c 2006-03-26 21:56:51.000000000 -0800 @@ -901,6 +901,22 @@ pci_set_consistent_dma_mask(struct pci_d } #endif +/** + * pci_select_bars - Make BAR mask from the type of resource + * @pdev: the PCI device for which BAR mask is made + * @flags: resource type mask to be selected + * + * This helper routine makes bar mask from the type of resource. + */ +int pci_select_bars(struct pci_dev *dev, unsigned long flags) +{ + int i, bars = 0; + for (i = 0; i < PCI_NUM_RESOURCES; i++) + if (pci_resource_flags(dev, i) & flags) + bars |= (1 << i); + return bars; +} + static int __devinit pci_init(void) { struct pci_dev *dev = NULL; @@ -958,6 +974,7 @@ EXPORT_SYMBOL(pci_set_dma_mask); EXPORT_SYMBOL(pci_set_consistent_dma_mask); EXPORT_SYMBOL(pci_assign_resource); EXPORT_SYMBOL(pci_find_parent_resource); +EXPORT_SYMBOL(pci_select_bars); EXPORT_SYMBOL(pci_set_power_state); EXPORT_SYMBOL(pci_save_state); diff -puN include/linux/pci.h~pci-legacy-i-o-port-free-driver-changes-to-generic-pci-code-fix include/linux/pci.h --- devel/include/linux/pci.h~pci-legacy-i-o-port-free-driver-changes-to-generic-pci-code-fix 2006-03-26 21:56:51.000000000 -0800 +++ devel-akpm/include/linux/pci.h 2006-03-26 21:56:51.000000000 -0800 @@ -467,6 +467,7 @@ int pci_set_consistent_dma_mask(struct p void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); int pci_assign_resource(struct pci_dev *dev, int i); void pci_restore_bars(struct pci_dev *dev); +int pci_select_bars(struct pci_dev *dev, unsigned long flags); /* ROM control related routines */ void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size); @@ -702,17 +703,6 @@ static inline void pci_resource_to_user( } #endif /* HAVE_ARCH_PCI_RESOURCE_TO_USER */ -/* - * This helper routine makes bar mask from the type of resource. - */ -static inline int pci_select_bars(struct pci_dev *dev, unsigned long flags) -{ - int i, bars = 0; - for (i = 0; i < PCI_NUM_RESOURCES; i++) - if (pci_resource_flags(dev, i) & flags) - bars |= (1 << i); - return bars; -} /* * The world is not perfect and supplies us with broken PCI devices. _