lkml.org 
[lkml]   [2012]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -v2 16/26] PCI: Use for_each_res pci release release
Date
Replace those open code, and make code more readable.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
drivers/pci/remove.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
index 18efb31..7dfe507 100644
--- a/drivers/pci/remove.c
+++ b/drivers/pci/remove.c
@@ -6,15 +6,14 @@
static void pci_free_resources(struct pci_dev *dev)
{
int i;
+ struct resource *res;

msi_remove_pci_irq_vectors(dev);

pci_cleanup_rom(dev);
- for (i = 0; i < PCI_NUM_RESOURCES; i++) {
- struct resource *res = dev->resource + i;
+ for_each_pci_dev_all_resource(dev, res, i)
if (res->parent)
release_resource(res);
- }
}

static void pci_stop_dev(struct pci_dev *dev)
--
1.7.7


\
 
 \ /
  Last update: 2012-03-19 06:55    [W:0.135 / U:8.540 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site