Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283357
b: refs/heads/master
c: 166c637
h: refs/heads/master
i:
  283355: f5e2372
v: v3
  • Loading branch information
Bjorn Helgaas authored and Jesse Barnes committed Jan 6, 2012
1 parent c87c6ee commit 541135c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a9d9f5276cb3fa08351e8837ab9398bfd8e69a2e
refs/heads/master: 166c6370754a0a92386e2ffb0eeb06e50ac8588d
25 changes: 21 additions & 4 deletions trunk/drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1522,12 +1522,13 @@ unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus)
return max;
}

struct pci_bus * pci_create_bus(struct device *parent,
int bus, struct pci_ops *ops, void *sysdata)
struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
struct pci_ops *ops, void *sysdata, struct list_head *resources)
{
int error, i;
struct pci_bus *b, *b2;
struct device *dev;
struct pci_bus_resource *bus_res, *n;
struct resource *res;

b = pci_alloc_bus();
Expand Down Expand Up @@ -1578,8 +1579,10 @@ struct pci_bus * pci_create_bus(struct device *parent,
pci_create_legacy_files(b);

b->number = b->secondary = bus;
b->resource[0] = &ioport_resource;
b->resource[1] = &iomem_resource;

/* Add initial resources to the bus */
list_for_each_entry_safe(bus_res, n, resources, list)
list_move_tail(&bus_res->list, &b->resources);

if (parent)
dev_info(parent, "PCI host bridge to bus %s\n", dev_name(&b->dev));
Expand All @@ -1605,6 +1608,20 @@ struct pci_bus * pci_create_bus(struct device *parent,
return NULL;
}

struct pci_bus *pci_create_bus(struct device *parent,
int bus, struct pci_ops *ops, void *sysdata)
{
LIST_HEAD(resources);
struct pci_bus *b;

pci_add_resource(&resources, &ioport_resource);
pci_add_resource(&resources, &iomem_resource);
b = pci_create_root_bus(parent, bus, ops, sysdata, &resources);
if (!b)
pci_free_resource_list(&resources);
return b;
}

struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent,
int bus, struct pci_ops *ops, void *sysdata)
{
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,9 @@ static inline struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *o
pci_bus_add_devices(root_bus);
return root_bus;
}
struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
struct pci_ops *ops, void *sysdata,
struct list_head *resources);
struct pci_bus *pci_create_bus(struct device *parent, int bus,
struct pci_ops *ops, void *sysdata);
struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
Expand Down

0 comments on commit 541135c

Please sign in to comment.