Commit fc075e1d authored by Ram Pai's avatar Ram Pai Committed by Jesse Barnes

PCI: introduce reset_resource()

Introduce reset_resource() which factors out resource reset logic.
Signed-off-by: default avatarRam Pai <linuxram@us.ibm.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 094732a5
...@@ -88,6 +88,13 @@ static void __dev_sort_resources(struct pci_dev *dev, ...@@ -88,6 +88,13 @@ static void __dev_sort_resources(struct pci_dev *dev,
pdev_sort_resources(dev, head); 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, static void __assign_resources_sorted(struct resource_list *head,
struct resource_list_x *fail_head) struct resource_list_x *fail_head)
{ {
...@@ -109,9 +116,7 @@ static void __assign_resources_sorted(struct resource_list *head, ...@@ -109,9 +116,7 @@ static void __assign_resources_sorted(struct resource_list *head,
(!(res->flags & IORESOURCE_ROM_ENABLE)))) (!(res->flags & IORESOURCE_ROM_ENABLE))))
add_to_failed_list(fail_head, list->dev, res); add_to_failed_list(fail_head, list->dev, res);
} }
res->start = 0; reset_resource(res);
res->end = 0;
res->flags = 0;
} }
tmp = list; tmp = list;
list = list->next; list = list->next;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment