diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2008-04-28 18:34:23 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-29 03:22:26 -0400 |
commit | be81b4a4838ce329b9f3978c7fc007b047c23722 (patch) | |
tree | 69ddf0e4ef6fe0c38388d3d7b7ea18ad0344d579 | |
parent | f5d94ff014cb7e6212f40fc6644f3fd68507df33 (diff) |
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>
-rw-r--r-- | drivers/pnp/resource.c | 32 |
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) | |||
270 | 270 | ||
271 | /* check for internal conflicts */ | 271 | /* check for internal conflicts */ |
272 | for (i = 0; i < PNP_MAX_PORT; i++) { | 272 | for (i = 0; i < PNP_MAX_PORT; i++) { |
273 | tres = &dev->res.port_resource[i]; | 273 | tres = pnp_get_resource(dev, IORESOURCE_IO, i); |
274 | if (tres != res && tres->flags & IORESOURCE_IO) { | 274 | if (tres && tres != res && tres->flags & IORESOURCE_IO) { |
275 | tport = &tres->start; | 275 | tport = &tres->start; |
276 | tend = &tres->end; | 276 | tend = &tres->end; |
277 | if (ranged_conflict(port, end, tport, tend)) | 277 | if (ranged_conflict(port, end, tport, tend)) |
@@ -284,8 +284,8 @@ int pnp_check_port(struct pnp_dev *dev, struct resource *res) | |||
284 | if (tdev == dev) | 284 | if (tdev == dev) |
285 | continue; | 285 | continue; |
286 | for (i = 0; i < PNP_MAX_PORT; i++) { | 286 | for (i = 0; i < PNP_MAX_PORT; i++) { |
287 | tres = &tdev->res.port_resource[i]; | 287 | tres = pnp_get_resource(tdev, IORESOURCE_IO, i); |
288 | if (tres->flags & IORESOURCE_IO) { | 288 | if (tres && tres->flags & IORESOURCE_IO) { |
289 | if (cannot_compare(tres->flags)) | 289 | if (cannot_compare(tres->flags)) |
290 | continue; | 290 | continue; |
291 | tport = &tres->start; | 291 | tport = &tres->start; |
@@ -330,8 +330,8 @@ int pnp_check_mem(struct pnp_dev *dev, struct resource *res) | |||
330 | 330 | ||
331 | /* check for internal conflicts */ | 331 | /* check for internal conflicts */ |
332 | for (i = 0; i < PNP_MAX_MEM; i++) { | 332 | for (i = 0; i < PNP_MAX_MEM; i++) { |
333 | tres = &dev->res.mem_resource[i]; | 333 | tres = pnp_get_resource(dev, IORESOURCE_MEM, i); |
334 | if (tres != res && tres->flags & IORESOURCE_MEM) { | 334 | if (tres && tres != res && tres->flags & IORESOURCE_MEM) { |
335 | taddr = &tres->start; | 335 | taddr = &tres->start; |
336 | tend = &tres->end; | 336 | tend = &tres->end; |
337 | if (ranged_conflict(addr, end, taddr, tend)) | 337 | if (ranged_conflict(addr, end, taddr, tend)) |
@@ -344,8 +344,8 @@ int pnp_check_mem(struct pnp_dev *dev, struct resource *res) | |||
344 | if (tdev == dev) | 344 | if (tdev == dev) |
345 | continue; | 345 | continue; |
346 | for (i = 0; i < PNP_MAX_MEM; i++) { | 346 | for (i = 0; i < PNP_MAX_MEM; i++) { |
347 | tres = &tdev->res.mem_resource[i]; | 347 | tres = pnp_get_resource(tdev, IORESOURCE_MEM, i); |
348 | if (tres->flags & IORESOURCE_MEM) { | 348 | if (tres && tres->flags & IORESOURCE_MEM) { |
349 | if (cannot_compare(tres->flags)) | 349 | if (cannot_compare(tres->flags)) |
350 | continue; | 350 | continue; |
351 | taddr = &tres->start; | 351 | taddr = &tres->start; |
@@ -389,8 +389,8 @@ int pnp_check_irq(struct pnp_dev *dev, struct resource *res) | |||
389 | 389 | ||
390 | /* check for internal conflicts */ | 390 | /* check for internal conflicts */ |
391 | for (i = 0; i < PNP_MAX_IRQ; i++) { | 391 | for (i = 0; i < PNP_MAX_IRQ; i++) { |
392 | tres = &dev->res.irq_resource[i]; | 392 | tres = pnp_get_resource(dev, IORESOURCE_IRQ, i); |
393 | if (tres != res && tres->flags & IORESOURCE_IRQ) { | 393 | if (tres && tres != res && tres->flags & IORESOURCE_IRQ) { |
394 | if (tres->start == *irq) | 394 | if (tres->start == *irq) |
395 | return 0; | 395 | return 0; |
396 | } | 396 | } |
@@ -423,8 +423,8 @@ int pnp_check_irq(struct pnp_dev *dev, struct resource *res) | |||
423 | if (tdev == dev) | 423 | if (tdev == dev) |
424 | continue; | 424 | continue; |
425 | for (i = 0; i < PNP_MAX_IRQ; i++) { | 425 | for (i = 0; i < PNP_MAX_IRQ; i++) { |
426 | tres = &tdev->res.irq_resource[i]; | 426 | tres = pnp_get_resource(tdev, IORESOURCE_IRQ, i); |
427 | if (tres->flags & IORESOURCE_IRQ) { | 427 | if (tres && tres->flags & IORESOURCE_IRQ) { |
428 | if (cannot_compare(tres->flags)) | 428 | if (cannot_compare(tres->flags)) |
429 | continue; | 429 | continue; |
430 | if (tres->start == *irq) | 430 | if (tres->start == *irq) |
@@ -462,8 +462,8 @@ int pnp_check_dma(struct pnp_dev *dev, struct resource *res) | |||
462 | 462 | ||
463 | /* check for internal conflicts */ | 463 | /* check for internal conflicts */ |
464 | for (i = 0; i < PNP_MAX_DMA; i++) { | 464 | for (i = 0; i < PNP_MAX_DMA; i++) { |
465 | tres = &dev->res.dma_resource[i]; | 465 | tres = pnp_get_resource(dev, IORESOURCE_DMA, i); |
466 | if (tres != res && tres->flags & IORESOURCE_DMA) { | 466 | if (tres && tres != res && tres->flags & IORESOURCE_DMA) { |
467 | if (tres->start == *dma) | 467 | if (tres->start == *dma) |
468 | return 0; | 468 | return 0; |
469 | } | 469 | } |
@@ -482,8 +482,8 @@ int pnp_check_dma(struct pnp_dev *dev, struct resource *res) | |||
482 | if (tdev == dev) | 482 | if (tdev == dev) |
483 | continue; | 483 | continue; |
484 | for (i = 0; i < PNP_MAX_DMA; i++) { | 484 | for (i = 0; i < PNP_MAX_DMA; i++) { |
485 | tres = &tdev->res.dma_resource[i]; | 485 | tres = pnp_get_resource(tdev, IORESOURCE_DMA, i); |
486 | if (tres->flags & IORESOURCE_DMA) { | 486 | if (tres && tres->flags & IORESOURCE_DMA) { |
487 | if (cannot_compare(tres->flags)) | 487 | if (cannot_compare(tres->flags)) |
488 | continue; | 488 | continue; |
489 | if (tres->start == *dma) | 489 | if (tres->start == *dma) |