aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2015-04-28 05:32:33 -0400
committerBjorn Helgaas <bhelgaas@google.com>2015-06-12 16:26:28 -0400
commit515d425bd2049e9f0f79131db58eb762fb95f2f6 (patch)
treec6dda99d8df8f7b08f52d9ff46e6a6530e2917c7
parent528d4bce1078f90352df909e8bcfd457d23797b2 (diff)
xen/pcifront: Don't use deprecated function pci_scan_bus_parented()
Use pci_scan_root_bus() instead of deprecated function pci_scan_bus_parented(). Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> CC: xen-devel@lists.xenproject.org
-rw-r--r--drivers/pci/xen-pcifront.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index 7cfd2db02deb..240f38872085 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -446,9 +446,15 @@ static int pcifront_scan_root(struct pcifront_device *pdev,
446 unsigned int domain, unsigned int bus) 446 unsigned int domain, unsigned int bus)
447{ 447{
448 struct pci_bus *b; 448 struct pci_bus *b;
449 LIST_HEAD(resources);
449 struct pcifront_sd *sd = NULL; 450 struct pcifront_sd *sd = NULL;
450 struct pci_bus_entry *bus_entry = NULL; 451 struct pci_bus_entry *bus_entry = NULL;
451 int err = 0; 452 int err = 0;
453 static struct resource busn_res = {
454 .start = 0,
455 .end = 255,
456 .flags = IORESOURCE_BUS,
457 };
452 458
453#ifndef CONFIG_PCI_DOMAINS 459#ifndef CONFIG_PCI_DOMAINS
454 if (domain != 0) { 460 if (domain != 0) {
@@ -470,17 +476,21 @@ static int pcifront_scan_root(struct pcifront_device *pdev,
470 err = -ENOMEM; 476 err = -ENOMEM;
471 goto err_out; 477 goto err_out;
472 } 478 }
479 pci_add_resource(&resources, &ioport_resource);
480 pci_add_resource(&resources, &iomem_resource);
481 pci_add_resource(&resources, &busn_res);
473 pcifront_init_sd(sd, domain, bus, pdev); 482 pcifront_init_sd(sd, domain, bus, pdev);
474 483
475 pci_lock_rescan_remove(); 484 pci_lock_rescan_remove();
476 485
477 b = pci_scan_bus_parented(&pdev->xdev->dev, bus, 486 b = pci_scan_root_bus(&pdev->xdev->dev, bus,
478 &pcifront_bus_ops, sd); 487 &pcifront_bus_ops, sd, &resources);
479 if (!b) { 488 if (!b) {
480 dev_err(&pdev->xdev->dev, 489 dev_err(&pdev->xdev->dev,
481 "Error creating PCI Frontend Bus!\n"); 490 "Error creating PCI Frontend Bus!\n");
482 err = -ENOMEM; 491 err = -ENOMEM;
483 pci_unlock_rescan_remove(); 492 pci_unlock_rescan_remove();
493 pci_free_resource_list(&resources);
484 goto err_out; 494 goto err_out;
485 } 495 }
486 496
@@ -488,7 +498,7 @@ static int pcifront_scan_root(struct pcifront_device *pdev,
488 498
489 list_add(&bus_entry->list, &pdev->root_buses); 499 list_add(&bus_entry->list, &pdev->root_buses);
490 500
491 /* pci_scan_bus_parented skips devices which do not have a have 501 /* pci_scan_root_bus skips devices which do not have a
492 * devfn==0. The pcifront_scan_bus enumerates all devfn. */ 502 * devfn==0. The pcifront_scan_bus enumerates all devfn. */
493 err = pcifront_scan_bus(pdev, domain, bus, b); 503 err = pcifront_scan_bus(pdev, domain, bus, b);
494 504