diff mbox

[3/4] PCI: introduce reset_resource()

Message ID 1297734200-23327-4-git-send-email-linuxram@us.ibm.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Ram Pai Feb. 15, 2011, 1:43 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index bcf5752..a94ecc1 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -88,6 +88,13 @@  static void __dev_sort_resources(struct pci_dev *dev,
 	pdev_sort_resources(dev, head);
 }
 
+static inline void reset_resource(struct resource *res)
+{
+	res->start = 0;
+	res->end = 0;
+	res->flags = 0;
+}
+
 static void __assign_resources_sorted(struct resource_list *head,
 				 struct resource_list_x *fail_head)
 {
@@ -109,9 +116,7 @@  static void __assign_resources_sorted(struct resource_list *head,
 				      (!(res->flags & IORESOURCE_ROM_ENABLE))))
 					add_to_failed_list(fail_head, list->dev, res);
 			}
-			res->start = 0;
-			res->end = 0;
-			res->flags = 0;
+			reset_resource(res);
 		}
 		tmp = list;
 		list = list->next;