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 15/26] PCI: Use for_each_res pci bases pci_dev_driver()
Date
Replace those open code, and make code more readable.

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

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 5d19695..a82c66f 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -1201,9 +1201,11 @@ pci_dev_driver(const struct pci_dev *dev)
if (dev->driver)
return dev->driver;
else {
+ struct resource *res;
int i;
- for(i=0; i<=PCI_ROM_RESOURCE; i++)
- if (dev->resource[i].flags & IORESOURCE_BUSY)
+
+ for_each_pci_dev_base_resource((struct pci_dev *)dev, res, i)
+ if (res->flags & IORESOURCE_BUSY)
return &pci_compat_driver;
}
return NULL;
--
1.7.7


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