Skip to content

Commit 515d425

Browse files
arndbbjorn-helgaas
authored andcommitted
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 <[email protected]> Signed-off-by: Yijing Wang <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> CC: Konrad Rzeszutek Wilk <[email protected]> CC: [email protected]
1 parent 528d4bc commit 515d425

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

drivers/pci/xen-pcifront.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,15 @@ static int pcifront_scan_root(struct pcifront_device *pdev,
446446
unsigned int domain, unsigned int bus)
447447
{
448448
struct pci_bus *b;
449+
LIST_HEAD(resources);
449450
struct pcifront_sd *sd = NULL;
450451
struct pci_bus_entry *bus_entry = NULL;
451452
int err = 0;
453+
static struct resource busn_res = {
454+
.start = 0,
455+
.end = 255,
456+
.flags = IORESOURCE_BUS,
457+
};
452458

453459
#ifndef CONFIG_PCI_DOMAINS
454460
if (domain != 0) {
@@ -470,25 +476,29 @@ static int pcifront_scan_root(struct pcifront_device *pdev,
470476
err = -ENOMEM;
471477
goto err_out;
472478
}
479+
pci_add_resource(&resources, &ioport_resource);
480+
pci_add_resource(&resources, &iomem_resource);
481+
pci_add_resource(&resources, &busn_res);
473482
pcifront_init_sd(sd, domain, bus, pdev);
474483

475484
pci_lock_rescan_remove();
476485

477-
b = pci_scan_bus_parented(&pdev->xdev->dev, bus,
478-
&pcifront_bus_ops, sd);
486+
b = pci_scan_root_bus(&pdev->xdev->dev, bus,
487+
&pcifront_bus_ops, sd, &resources);
479488
if (!b) {
480489
dev_err(&pdev->xdev->dev,
481490
"Error creating PCI Frontend Bus!\n");
482491
err = -ENOMEM;
483492
pci_unlock_rescan_remove();
493+
pci_free_resource_list(&resources);
484494
goto err_out;
485495
}
486496

487497
bus_entry->bus = b;
488498

489499
list_add(&bus_entry->list, &pdev->root_buses);
490500

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
492502
* devfn==0. The pcifront_scan_bus enumerates all devfn. */
493503
err = pcifront_scan_bus(pdev, domain, bus, b);
494504

0 commit comments

Comments
 (0)