diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug/rpadlpar_core.c | 6 | ||||
-rw-r--r-- | drivers/pci/pci-sysfs.c | 2 | ||||
-rw-r--r-- | drivers/pci/probe.c | 12 | ||||
-rw-r--r-- | drivers/pci/proc.c | 2 | ||||
-rw-r--r-- | drivers/pci/search.c | 4 |
5 files changed, 19 insertions, 7 deletions
diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c index bb3c101c2c5..deb6b5e35fe 100644 --- a/drivers/pci/hotplug/rpadlpar_core.c +++ b/drivers/pci/hotplug/rpadlpar_core.c @@ -159,8 +159,8 @@ static void dlpar_pci_add_bus(struct device_node *dn) /* Claim new bus resources */ pcibios_claim_one_bus(dev->bus); - /* ioremap() for child bus, which may or may not succeed */ - remap_bus_range(dev->subordinate); + /* Map IO space for child bus, which may or may not succeed */ + pcibios_map_io_space(dev->subordinate); /* Add new devices to global lists. Register in proc, sysfs. */ pci_bus_add_devices(phb->bus); @@ -390,7 +390,7 @@ int dlpar_remove_pci_slot(char *drc_name, struct device_node *dn) } else pcibios_remove_pci_devices(bus); - if (unmap_bus_range(bus)) { + if (pcibios_unmap_io_space(bus)) { printk(KERN_ERR "%s: failed to unmap bus range\n", __FUNCTION__); return -ERANGE; diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 10dbdec8041..1b7b2812bf2 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -20,7 +20,7 @@ #include <linux/stat.h> #include <linux/topology.h> #include <linux/mm.h> - +#include <linux/capability.h> #include "pci.h" static int sysfs_initialized; /* = 0 */ diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index a7bce75c673..34b8dae0d90 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -22,6 +22,18 @@ EXPORT_SYMBOL(pci_root_buses); LIST_HEAD(pci_devices); +/* + * Some device drivers need know if pci is initiated. + * Basically, we think pci is not initiated when there + * is no device in list of pci_devices. + */ +int no_pci_devices(void) +{ + return list_empty(&pci_devices); +} + +EXPORT_SYMBOL(no_pci_devices); + #ifdef HAVE_PCI_LEGACY /** * pci_create_legacy_files - create legacy I/O port and memory files diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c index cfa0dfe61b1..90adc62d07f 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c @@ -11,7 +11,7 @@ #include <linux/module.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> - +#include <linux/capability.h> #include <asm/uaccess.h> #include <asm/byteorder.h> #include "pci.h" diff --git a/drivers/pci/search.c b/drivers/pci/search.c index 9f7090fa877..c6e79d01ce3 100644 --- a/drivers/pci/search.c +++ b/drivers/pci/search.c @@ -202,7 +202,7 @@ static struct pci_dev * pci_find_subsys(unsigned int vendor, * can cause some machines to crash. So here we detect and flag that * situation and bail out early. */ - if (unlikely(list_empty(&pci_devices))) + if (unlikely(no_pci_devices())) return NULL; down_read(&pci_bus_sem); n = from ? from->global_list.next : pci_devices.next; @@ -277,7 +277,7 @@ pci_get_subsys(unsigned int vendor, unsigned int device, * can cause some machines to crash. So here we detect and flag that * situation and bail out early. */ - if (unlikely(list_empty(&pci_devices))) + if (unlikely(no_pci_devices())) return NULL; down_read(&pci_bus_sem); n = from ? from->global_list.next : pci_devices.next; |