Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Arnd Bergmann and committed by
Bjorn Helgaas
515d425b 528d4bce

+13 -3
+13 -3
drivers/pci/xen-pcifront.c
··· 446 446 unsigned int domain, unsigned int bus) 447 447 { 448 448 struct pci_bus *b; 449 + LIST_HEAD(resources); 449 450 struct pcifront_sd *sd = NULL; 450 451 struct pci_bus_entry *bus_entry = NULL; 451 452 int err = 0; 453 + static struct resource busn_res = { 454 + .start = 0, 455 + .end = 255, 456 + .flags = IORESOURCE_BUS, 457 + }; 452 458 453 459 #ifndef CONFIG_PCI_DOMAINS 454 460 if (domain != 0) { ··· 476 470 err = -ENOMEM; 477 471 goto err_out; 478 472 } 473 + pci_add_resource(&resources, &ioport_resource); 474 + pci_add_resource(&resources, &iomem_resource); 475 + pci_add_resource(&resources, &busn_res); 479 476 pcifront_init_sd(sd, domain, bus, pdev); 480 477 481 478 pci_lock_rescan_remove(); 482 479 483 - b = pci_scan_bus_parented(&pdev->xdev->dev, bus, 484 - &pcifront_bus_ops, sd); 480 + b = pci_scan_root_bus(&pdev->xdev->dev, bus, 481 + &pcifront_bus_ops, sd, &resources); 485 482 if (!b) { 486 483 dev_err(&pdev->xdev->dev, 487 484 "Error creating PCI Frontend Bus!\n"); 488 485 err = -ENOMEM; 489 486 pci_unlock_rescan_remove(); 487 + pci_free_resource_list(&resources); 490 488 goto err_out; 491 489 } 492 490 ··· 498 488 499 489 list_add(&bus_entry->list, &pdev->root_buses); 500 490 501 - /* pci_scan_bus_parented skips devices which do not have a have 491 + /* pci_scan_root_bus skips devices which do not have a 502 492 * devfn==0. The pcifront_scan_bus enumerates all devfn. */ 503 493 err = pcifront_scan_bus(pdev, domain, bus, b); 504 494