@@ -446,9 +446,15 @@ static int pcifront_scan_root(struct pcifront_device *pdev,
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 ) {
@@ -470,25 +476,29 @@ static int pcifront_scan_root(struct pcifront_device *pdev,
470
476
err = - ENOMEM ;
471
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
482
pcifront_init_sd (sd , domain , bus , pdev );
474
483
475
484
pci_lock_rescan_remove ();
476
485
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 );
479
488
if (!b ) {
480
489
dev_err (& pdev -> xdev -> dev ,
481
490
"Error creating PCI Frontend Bus!\n" );
482
491
err = - ENOMEM ;
483
492
pci_unlock_rescan_remove ();
493
+ pci_free_resource_list (& resources );
484
494
goto err_out ;
485
495
}
486
496
487
497
bus_entry -> bus = b ;
488
498
489
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
502
* devfn==0. The pcifront_scan_bus enumerates all devfn. */
493
503
err = pcifront_scan_bus (pdev , domain , bus , b );
494
504
0 commit comments