提交 eae91c02 编写于 作者: M Matthew Wilcox 提交者: Jesse Barnes

frv/PCI: Use pci_claim_resource

Instead of open-coding pci_find_parent_resource and request_resource,
just call pci_claim_resource.
Acked-by: NDavid Howells <dhowells@redhat.com>
Signed-off-by: NMatthew Wilcox <willy@linux.intel.com>
Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
上级 a7db5040
...@@ -86,7 +86,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list) ...@@ -86,7 +86,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
struct pci_bus *bus; struct pci_bus *bus;
struct pci_dev *dev; struct pci_dev *dev;
int idx; int idx;
struct resource *r, *pr; struct resource *r;
/* Depth-First Search on bus tree */ /* Depth-First Search on bus tree */
for (ln=bus_list->next; ln != bus_list; ln=ln->next) { for (ln=bus_list->next; ln != bus_list; ln=ln->next) {
...@@ -96,8 +96,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list) ...@@ -96,8 +96,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
r = &dev->resource[idx]; r = &dev->resource[idx];
if (!r->start) if (!r->start)
continue; continue;
pr = pci_find_parent_resource(dev, r); if (pci_claim_resource(dev, idx) < 0)
if (!pr || request_resource(pr, r) < 0)
printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev)); printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev));
} }
} }
...@@ -110,7 +109,7 @@ static void __init pcibios_allocate_resources(int pass) ...@@ -110,7 +109,7 @@ static void __init pcibios_allocate_resources(int pass)
struct pci_dev *dev = NULL; struct pci_dev *dev = NULL;
int idx, disabled; int idx, disabled;
u16 command; u16 command;
struct resource *r, *pr; struct resource *r;
for_each_pci_dev(dev) { for_each_pci_dev(dev) {
pci_read_config_word(dev, PCI_COMMAND, &command); pci_read_config_word(dev, PCI_COMMAND, &command);
...@@ -127,8 +126,7 @@ static void __init pcibios_allocate_resources(int pass) ...@@ -127,8 +126,7 @@ static void __init pcibios_allocate_resources(int pass)
if (pass == disabled) { if (pass == disabled) {
DBG("PCI: Resource %08lx-%08lx (f=%lx, d=%d, p=%d)\n", DBG("PCI: Resource %08lx-%08lx (f=%lx, d=%d, p=%d)\n",
r->start, r->end, r->flags, disabled, pass); r->start, r->end, r->flags, disabled, pass);
pr = pci_find_parent_resource(dev, r); if (pci_claim_resource(dev, idx) < 0) {
if (!pr || request_resource(pr, r) < 0) {
printk(KERN_ERR "PCI: Cannot allocate resource region %d of device %s\n", idx, pci_name(dev)); printk(KERN_ERR "PCI: Cannot allocate resource region %d of device %s\n", idx, pci_name(dev));
/* We'll assign a new address later */ /* We'll assign a new address later */
r->end -= r->start; r->end -= r->start;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册