powerpc/PCI: Deprecate pci_get_bus_and_slot()
authorSinan Kaya <okaya@codeaurora.org>
Tue, 19 Dec 2017 05:37:38 +0000 (00:37 -0500)
committerBjorn Helgaas <helgaas@kernel.org>
Thu, 11 Jan 2018 23:21:55 +0000 (17:21 -0600)
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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use pci_get_domain_bus_and_slot() with a domain number of 0 as the code
is not ready to consume multiple domains and existing code used domain
number 0.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/pci_32.c
arch/powerpc/platforms/powermac/feature.c
arch/powerpc/sysdev/mv64x60_pci.c

index 1d817f4d97d960cae8b2c75ec580588538c31282..85ad2f78b8896d2e0da989782b9bc374f7fa6857 100644 (file)
@@ -96,7 +96,8 @@ make_one_node_map(struct device_node* node, u8 pci_bus)
                reg = of_get_property(node, "reg", NULL);
                if (!reg)
                        continue;
-               dev = pci_get_bus_and_slot(pci_bus, ((reg[0] >> 8) & 0xff));
+               dev = pci_get_domain_bus_and_slot(0, pci_bus,
+                                                 ((reg[0] >> 8) & 0xff));
                if (!dev || !dev->subordinate) {
                        pci_dev_put(dev);
                        continue;
index 9e3f39d36e88ff32dfd2c7585ef635ec2daf5e2d..ed8b16694153f36d1263f117ee48405f549b3183 100644 (file)
@@ -829,7 +829,7 @@ core99_ata100_enable(struct device_node *node, long value)
 
        if (value) {
                if (pci_device_from_OF_node(node, &pbus, &pid) == 0)
-                       pdev = pci_get_bus_and_slot(pbus, pid);
+                       pdev = pci_get_domain_bus_and_slot(0, pbus, pid);
                if (pdev == NULL)
                        return 0;
                rc = pci_enable_device(pdev);
index d52b3b81e05fba706af2012804fcf410f5d8c2b4..6fe9104632a0040d0d85e688bc6dc99e273072b2 100644 (file)
@@ -37,7 +37,7 @@ static ssize_t mv64x60_hs_reg_read(struct file *filp, struct kobject *kobj,
        if (count < MV64X60_VAL_LEN_MAX)
                return -EINVAL;
 
-       phb = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+       phb = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
        if (!phb)
                return -ENODEV;
        pci_read_config_dword(phb, MV64X60_PCICFG_CPCI_HOTSWAP, &v);
@@ -61,7 +61,7 @@ static ssize_t mv64x60_hs_reg_write(struct file *filp, struct kobject *kobj,
        if (sscanf(buf, "%i", &v) != 1)
                return -EINVAL;
 
-       phb = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+       phb = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
        if (!phb)
                return -ENODEV;
        pci_write_config_dword(phb, MV64X60_PCICFG_CPCI_HOTSWAP, v);