aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ia64/sn/kernel/io_common.c4
-rw-r--r--drivers/gpu/vga/vgaarb.c15
-rw-r--r--drivers/pci/hotplug/cpcihp_generic.c8
-rw-r--r--drivers/pci/iov.c8
-rw-r--r--drivers/pci/xen-pcifront.c10
5 files changed, 10 insertions, 35 deletions
diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c
index fbb5f2f87eed..8630875e74b5 100644
--- a/arch/ia64/sn/kernel/io_common.c
+++ b/arch/ia64/sn/kernel/io_common.c
@@ -229,7 +229,6 @@ void sn_pci_fixup_slot(struct pci_dev *dev, struct pcidev_info *pcidev_info,
229{ 229{
230 int segment = pci_domain_nr(dev->bus); 230 int segment = pci_domain_nr(dev->bus);
231 struct pcibus_bussoft *bs; 231 struct pcibus_bussoft *bs;
232 struct pci_bus *host_pci_bus;
233 struct pci_dev *host_pci_dev; 232 struct pci_dev *host_pci_dev;
234 unsigned int bus_no, devfn; 233 unsigned int bus_no, devfn;
235 234
@@ -245,8 +244,7 @@ void sn_pci_fixup_slot(struct pci_dev *dev, struct pcidev_info *pcidev_info,
245 244
246 bus_no = (pcidev_info->pdi_slot_host_handle >> 32) & 0xff; 245 bus_no = (pcidev_info->pdi_slot_host_handle >> 32) & 0xff;
247 devfn = pcidev_info->pdi_slot_host_handle & 0xffffffff; 246 devfn = pcidev_info->pdi_slot_host_handle & 0xffffffff;
248 host_pci_bus = pci_find_bus(segment, bus_no); 247 host_pci_dev = pci_get_domain_bus_and_slot(segment, bus_no, devfn);
249 host_pci_dev = pci_get_slot(host_pci_bus, devfn);
250 248
251 pcidev_info->host_pci_dev = host_pci_dev; 249 pcidev_info->host_pci_dev = host_pci_dev;
252 pcidev_info->pdi_linux_pcidev = dev; 250 pcidev_info->pdi_linux_pcidev = dev;
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index 3df8fc0ec01a..b6852b776931 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -1066,7 +1066,6 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf,
1066 } 1066 }
1067 1067
1068 } else if (strncmp(curr_pos, "target ", 7) == 0) { 1068 } else if (strncmp(curr_pos, "target ", 7) == 0) {
1069 struct pci_bus *pbus;
1070 unsigned int domain, bus, devfn; 1069 unsigned int domain, bus, devfn;
1071 struct vga_device *vgadev; 1070 struct vga_device *vgadev;
1072 1071
@@ -1085,19 +1084,11 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf,
1085 pr_debug("vgaarb: %s ==> %x:%x:%x.%x\n", curr_pos, 1084 pr_debug("vgaarb: %s ==> %x:%x:%x.%x\n", curr_pos,
1086 domain, bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); 1085 domain, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
1087 1086
1088 pbus = pci_find_bus(domain, bus); 1087 pdev = pci_get_domain_bus_and_slot(domain, bus, devfn);
1089 pr_debug("vgaarb: pbus %p\n", pbus);
1090 if (pbus == NULL) {
1091 pr_err("vgaarb: invalid PCI domain and/or bus address %x:%x\n",
1092 domain, bus);
1093 ret_val = -ENODEV;
1094 goto done;
1095 }
1096 pdev = pci_get_slot(pbus, devfn);
1097 pr_debug("vgaarb: pdev %p\n", pdev); 1088 pr_debug("vgaarb: pdev %p\n", pdev);
1098 if (!pdev) { 1089 if (!pdev) {
1099 pr_err("vgaarb: invalid PCI address %x:%x\n", 1090 pr_err("vgaarb: invalid PCI address %x:%x:%x\n",
1100 bus, devfn); 1091 domain, bus, devfn);
1101 ret_val = -ENODEV; 1092 ret_val = -ENODEV;
1102 goto done; 1093 goto done;
1103 } 1094 }
diff --git a/drivers/pci/hotplug/cpcihp_generic.c b/drivers/pci/hotplug/cpcihp_generic.c
index 81af764c629b..a6a71c41cdf8 100644
--- a/drivers/pci/hotplug/cpcihp_generic.c
+++ b/drivers/pci/hotplug/cpcihp_generic.c
@@ -154,12 +154,8 @@ static int __init cpcihp_generic_init(void)
154 if(!r) 154 if(!r)
155 return -EBUSY; 155 return -EBUSY;
156 156
157 bus = pci_find_bus(0, bridge_busnr); 157 dev = pci_get_domain_bus_and_slot(0, bridge_busnr,
158 if (!bus) { 158 PCI_DEVFN(bridge_slot, 0));
159 err("Invalid bus number %d", bridge_busnr);
160 return -EINVAL;
161 }
162 dev = pci_get_slot(bus, PCI_DEVFN(bridge_slot, 0));
163 if(!dev || dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) { 159 if(!dev || dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) {
164 err("Invalid bridge device %s", bridge); 160 err("Invalid bridge device %s", bridge);
165 pci_dev_put(dev); 161 pci_dev_put(dev);
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index aeccc911abb8..b0fe7712b4d4 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -152,15 +152,11 @@ failed1:
152static void virtfn_remove(struct pci_dev *dev, int id, int reset) 152static void virtfn_remove(struct pci_dev *dev, int id, int reset)
153{ 153{
154 char buf[VIRTFN_ID_LEN]; 154 char buf[VIRTFN_ID_LEN];
155 struct pci_bus *bus;
156 struct pci_dev *virtfn; 155 struct pci_dev *virtfn;
157 struct pci_sriov *iov = dev->sriov; 156 struct pci_sriov *iov = dev->sriov;
158 157
159 bus = pci_find_bus(pci_domain_nr(dev->bus), virtfn_bus(dev, id)); 158 virtfn = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus),
160 if (!bus) 159 virtfn_bus(dev, id), virtfn_devfn(dev, id));
161 return;
162
163 virtfn = pci_get_slot(bus, virtfn_devfn(dev, id));
164 if (!virtfn) 160 if (!virtfn)
165 return; 161 return;
166 162
diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index d6cc62cb4cf7..def8d0b5620c 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -982,7 +982,6 @@ static int pcifront_detach_devices(struct pcifront_device *pdev)
982 int err = 0; 982 int err = 0;
983 int i, num_devs; 983 int i, num_devs;
984 unsigned int domain, bus, slot, func; 984 unsigned int domain, bus, slot, func;
985 struct pci_bus *pci_bus;
986 struct pci_dev *pci_dev; 985 struct pci_dev *pci_dev;
987 char str[64]; 986 char str[64];
988 987
@@ -1032,13 +1031,8 @@ static int pcifront_detach_devices(struct pcifront_device *pdev)
1032 goto out; 1031 goto out;
1033 } 1032 }
1034 1033
1035 pci_bus = pci_find_bus(domain, bus); 1034 pci_dev = pci_get_domain_bus_and_slot(domain, bus,
1036 if (!pci_bus) { 1035 PCI_DEVFN(slot, func));
1037 dev_dbg(&pdev->xdev->dev, "Cannot get bus %04x:%02x\n",
1038 domain, bus);
1039 continue;
1040 }
1041 pci_dev = pci_get_slot(pci_bus, PCI_DEVFN(slot, func));
1042 if (!pci_dev) { 1036 if (!pci_dev) {
1043 dev_dbg(&pdev->xdev->dev, 1037 dev_dbg(&pdev->xdev->dev,
1044 "Cannot get PCI device %04x:%02x:%02x.%d\n", 1038 "Cannot get PCI device %04x:%02x:%02x.%d\n",