summaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-28 16:34:23 -0600
committerLen Brown <len.brown@intel.com>2008-04-29 03:22:26 -0400
commitbe81b4a4838ce329b9f3978c7fc007b047c23722 (patch)
tree69ddf0e4ef6fe0c38388d3d7b7ea18ad0344d579 /drivers/pnp
parentf5d94ff014cb7e6212f40fc6644f3fd68507df33 (diff)
downloadblackbird-op-linux-be81b4a4838ce329b9f3978c7fc007b047c23722.tar.gz
blackbird-op-linux-be81b4a4838ce329b9f3978c7fc007b047c23722.zip
PNP: convert resource checks to use pnp_get_resource(), not pnp_resource_table
This removes more direct references to pnp_resource_table. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Acked-By: Rene Herman <rene.herman@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/resource.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
index 93bf45e01f2c..b2516d62fcf6 100644
--- a/drivers/pnp/resource.c
+++ b/drivers/pnp/resource.c
@@ -270,8 +270,8 @@ int pnp_check_port(struct pnp_dev *dev, struct resource *res)
/* check for internal conflicts */
for (i = 0; i < PNP_MAX_PORT; i++) {
- tres = &dev->res.port_resource[i];
- if (tres != res && tres->flags & IORESOURCE_IO) {
+ tres = pnp_get_resource(dev, IORESOURCE_IO, i);
+ if (tres && tres != res && tres->flags & IORESOURCE_IO) {
tport = &tres->start;
tend = &tres->end;
if (ranged_conflict(port, end, tport, tend))
@@ -284,8 +284,8 @@ int pnp_check_port(struct pnp_dev *dev, struct resource *res)
if (tdev == dev)
continue;
for (i = 0; i < PNP_MAX_PORT; i++) {
- tres = &tdev->res.port_resource[i];
- if (tres->flags & IORESOURCE_IO) {
+ tres = pnp_get_resource(tdev, IORESOURCE_IO, i);
+ if (tres && tres->flags & IORESOURCE_IO) {
if (cannot_compare(tres->flags))
continue;
tport = &tres->start;
@@ -330,8 +330,8 @@ int pnp_check_mem(struct pnp_dev *dev, struct resource *res)
/* check for internal conflicts */
for (i = 0; i < PNP_MAX_MEM; i++) {
- tres = &dev->res.mem_resource[i];
- if (tres != res && tres->flags & IORESOURCE_MEM) {
+ tres = pnp_get_resource(dev, IORESOURCE_MEM, i);
+ if (tres && tres != res && tres->flags & IORESOURCE_MEM) {
taddr = &tres->start;
tend = &tres->end;
if (ranged_conflict(addr, end, taddr, tend))
@@ -344,8 +344,8 @@ int pnp_check_mem(struct pnp_dev *dev, struct resource *res)
if (tdev == dev)
continue;
for (i = 0; i < PNP_MAX_MEM; i++) {
- tres = &tdev->res.mem_resource[i];
- if (tres->flags & IORESOURCE_MEM) {
+ tres = pnp_get_resource(tdev, IORESOURCE_MEM, i);
+ if (tres && tres->flags & IORESOURCE_MEM) {
if (cannot_compare(tres->flags))
continue;
taddr = &tres->start;
@@ -389,8 +389,8 @@ int pnp_check_irq(struct pnp_dev *dev, struct resource *res)
/* check for internal conflicts */
for (i = 0; i < PNP_MAX_IRQ; i++) {
- tres = &dev->res.irq_resource[i];
- if (tres != res && tres->flags & IORESOURCE_IRQ) {
+ tres = pnp_get_resource(dev, IORESOURCE_IRQ, i);
+ if (tres && tres != res && tres->flags & IORESOURCE_IRQ) {
if (tres->start == *irq)
return 0;
}
@@ -423,8 +423,8 @@ int pnp_check_irq(struct pnp_dev *dev, struct resource *res)
if (tdev == dev)
continue;
for (i = 0; i < PNP_MAX_IRQ; i++) {
- tres = &tdev->res.irq_resource[i];
- if (tres->flags & IORESOURCE_IRQ) {
+ tres = pnp_get_resource(tdev, IORESOURCE_IRQ, i);
+ if (tres && tres->flags & IORESOURCE_IRQ) {
if (cannot_compare(tres->flags))
continue;
if (tres->start == *irq)
@@ -462,8 +462,8 @@ int pnp_check_dma(struct pnp_dev *dev, struct resource *res)
/* check for internal conflicts */
for (i = 0; i < PNP_MAX_DMA; i++) {
- tres = &dev->res.dma_resource[i];
- if (tres != res && tres->flags & IORESOURCE_DMA) {
+ tres = pnp_get_resource(dev, IORESOURCE_DMA, i);
+ if (tres && tres != res && tres->flags & IORESOURCE_DMA) {
if (tres->start == *dma)
return 0;
}
@@ -482,8 +482,8 @@ int pnp_check_dma(struct pnp_dev *dev, struct resource *res)
if (tdev == dev)
continue;
for (i = 0; i < PNP_MAX_DMA; i++) {
- tres = &tdev->res.dma_resource[i];
- if (tres->flags & IORESOURCE_DMA) {
+ tres = pnp_get_resource(tdev, IORESOURCE_DMA, i);
+ if (tres && tres->flags & IORESOURCE_DMA) {
if (cannot_compare(tres->flags))
continue;
if (tres->start == *dma)
OpenPOWER on IntegriCloud