alpha: deprecate pci_get_bus_and_slot()
authorSinan Kaya <okaya@codeaurora.org>
Mon, 27 Nov 2017 16:57:38 +0000 (11:57 -0500)
committerMatt Turner <mattst88@gmail.com>
Sun, 21 Jan 2018 01:01:04 +0000 (17:01 -0800)
pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Use pci_get_domain_bus_and_slot() with a domain number of 0 where we can't
extract the domain number. Other places, use the actual domain number from
the device.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
arch/alpha/kernel/pci.c
arch/alpha/kernel/sys_nautilus.c

index 87da0057994665e5d9594388ff1d451964f98ccc..2e86ebb680ae52c12976c5cd47e500375fc11448 100644 (file)
@@ -425,7 +425,7 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn)
                if (bus == 0 && dfn == 0) {
                        hose = pci_isa_hose;
                } else {
-                       dev = pci_get_bus_and_slot(bus, dfn);
+                       dev = pci_get_domain_bus_and_slot(0, bus, dfn);
                        if (!dev)
                                return -ENODEV;
                        hose = dev->sysdata;
index 239dc0e601d536ab05d08c83dfebfcc02567a405..ff4f54b86c7f5628e42b519c6115913fde5bf371 100644 (file)
@@ -237,7 +237,7 @@ nautilus_init_pci(void)
        bus = hose->bus = bridge->bus;
        pcibios_claim_one_bus(bus);
 
-       irongate = pci_get_bus_and_slot(0, 0);
+       irongate = pci_get_domain_bus_and_slot(pci_domain_nr(bus), 0, 0);
        bus->self = irongate;
        bus->resource[0] = &irongate_io;
        bus->resource[1] = &irongate_mem;