diff mbox

[1/3] frv: Use pci_claim_resource

Message ID 1245418575-21764-2-git-send-email-willy@linux.intel.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Matthew Wilcox June 19, 2009, 1:36 p.m. UTC
Instead of open-coding pci_find_parent_resource and request_resource,
just call pci_claim_resource.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
---
 arch/frv/mb93090-mb00/pci-frv.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

Comments

Jesse Barnes June 29, 2009, 8:36 p.m. UTC | #1
On Fri, 19 Jun 2009 09:36:13 -0400
Matthew Wilcox <willy@linux.intel.com> wrote:

> Instead of open-coding pci_find_parent_resource and request_resource,
> just call pci_claim_resource.
> 
> Signed-off-by: Matthew Wilcox <willy@linux.intel.com>

Applied this series to my linux-next branch, thanks.

David, let me know if you have a problem with these and I'll drop them
or we can fix things up.
David Howells June 30, 2009, 8:44 p.m. UTC | #2
Matthew Wilcox <willy@linux.intel.com> (by way of Jesse Barnes <jbarnes@virtuousgeek.org>) wrote:

> Subject: [PATCH 1/3] frv: Use pci_claim_resource
> 
> Instead of open-coding pci_find_parent_resource and request_resource,
> just call pci_claim_resource.
> 
> Signed-off-by: Matthew Wilcox <willy@linux.intel.com>

Acked-by: David Howells <dhowells@redhat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/frv/mb93090-mb00/pci-frv.c b/arch/frv/mb93090-mb00/pci-frv.c
index 43d6753..566bdeb 100644
--- a/arch/frv/mb93090-mb00/pci-frv.c
+++ b/arch/frv/mb93090-mb00/pci-frv.c
@@ -86,7 +86,7 @@  static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
 	struct pci_bus *bus;
 	struct pci_dev *dev;
 	int idx;
-	struct resource *r, *pr;
+	struct resource *r;
 
 	/* Depth-First Search on bus tree */
 	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)
 				r = &dev->resource[idx];
 				if (!r->start)
 					continue;
-				pr = pci_find_parent_resource(dev, r);
-				if (!pr || request_resource(pr, r) < 0)
+				if (pci_claim_resource(dev, idx) < 0)
 					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)
 	struct pci_dev *dev = NULL;
 	int idx, disabled;
 	u16 command;
-	struct resource *r, *pr;
+	struct resource *r;
 
 	for_each_pci_dev(dev) {
 		pci_read_config_word(dev, PCI_COMMAND, &command);
@@ -127,8 +126,7 @@  static void __init pcibios_allocate_resources(int pass)
 			if (pass == disabled) {
 				DBG("PCI: Resource %08lx-%08lx (f=%lx, d=%d, p=%d)\n",
 				    r->start, r->end, r->flags, disabled, pass);
-				pr = pci_find_parent_resource(dev, r);
-				if (!pr || request_resource(pr, r) < 0) {
+				if (pci_claim_resource(dev, idx) < 0) {
 					printk(KERN_ERR "PCI: Cannot allocate resource region %d of device %s\n", idx, pci_name(dev));
 					/* We'll assign a new address later */
 					r->end -= r->start;