diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2008-04-28 18:34:25 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-29 03:22:26 -0400 |
commit | f6505fef18644557f732468c1f22f84560d8a819 (patch) | |
tree | 942bf646b502369e3f8e8f398265d0872e8d3a0c /drivers/pnp/interface.c | |
parent | 7e2cf31f1c97ac14b6d9dc5f1ce9e1e01aef9c18 (diff) |
PNP: convert assign, interface to use pnp_get_resource(), not pnp_resource_table
This removes more direct references to pnp_resource_table from the
pnp_assign_resources() path and the /sys user interface path.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp/interface.c')
-rw-r--r-- | drivers/pnp/interface.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c index 1801df3db1e..a608054a3e5 100644 --- a/drivers/pnp/interface.c +++ b/drivers/pnp/interface.c | |||
@@ -383,7 +383,10 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr, | |||
383 | buf += 2; | 383 | buf += 2; |
384 | while (isspace(*buf)) | 384 | while (isspace(*buf)) |
385 | ++buf; | 385 | ++buf; |
386 | res = &dev->res.port_resource[nport]; | 386 | res = pnp_get_resource(dev, IORESOURCE_IO, |
387 | nport); | ||
388 | if (!res) | ||
389 | break; | ||
387 | res->start = simple_strtoul(buf, &buf, 0); | 390 | res->start = simple_strtoul(buf, &buf, 0); |
388 | while (isspace(*buf)) | 391 | while (isspace(*buf)) |
389 | ++buf; | 392 | ++buf; |
@@ -396,15 +399,16 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr, | |||
396 | res->end = res->start; | 399 | res->end = res->start; |
397 | res->flags = IORESOURCE_IO; | 400 | res->flags = IORESOURCE_IO; |
398 | nport++; | 401 | nport++; |
399 | if (nport >= PNP_MAX_PORT) | ||
400 | break; | ||
401 | continue; | 402 | continue; |
402 | } | 403 | } |
403 | if (!strnicmp(buf, "mem", 3)) { | 404 | if (!strnicmp(buf, "mem", 3)) { |
404 | buf += 3; | 405 | buf += 3; |
405 | while (isspace(*buf)) | 406 | while (isspace(*buf)) |
406 | ++buf; | 407 | ++buf; |
407 | res = &dev->res.mem_resource[nmem]; | 408 | res = pnp_get_resource(dev, IORESOURCE_MEM, |
409 | nmem); | ||
410 | if (!res) | ||
411 | break; | ||
408 | res->start = simple_strtoul(buf, &buf, 0); | 412 | res->start = simple_strtoul(buf, &buf, 0); |
409 | while (isspace(*buf)) | 413 | while (isspace(*buf)) |
410 | ++buf; | 414 | ++buf; |
@@ -417,34 +421,34 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr, | |||
417 | res->end = res->start; | 421 | res->end = res->start; |
418 | res->flags = IORESOURCE_MEM; | 422 | res->flags = IORESOURCE_MEM; |
419 | nmem++; | 423 | nmem++; |
420 | if (nmem >= PNP_MAX_MEM) | ||
421 | break; | ||
422 | continue; | 424 | continue; |
423 | } | 425 | } |
424 | if (!strnicmp(buf, "irq", 3)) { | 426 | if (!strnicmp(buf, "irq", 3)) { |
425 | buf += 3; | 427 | buf += 3; |
426 | while (isspace(*buf)) | 428 | while (isspace(*buf)) |
427 | ++buf; | 429 | ++buf; |
428 | res = &dev->res.irq_resource[nirq]; | 430 | res = pnp_get_resource(dev, IORESOURCE_IRQ, |
431 | nirq); | ||
432 | if (!res) | ||
433 | break; | ||
429 | res->start = res->end = | 434 | res->start = res->end = |
430 | simple_strtoul(buf, &buf, 0); | 435 | simple_strtoul(buf, &buf, 0); |
431 | res->flags = IORESOURCE_IRQ; | 436 | res->flags = IORESOURCE_IRQ; |
432 | nirq++; | 437 | nirq++; |
433 | if (nirq >= PNP_MAX_IRQ) | ||
434 | break; | ||
435 | continue; | 438 | continue; |
436 | } | 439 | } |
437 | if (!strnicmp(buf, "dma", 3)) { | 440 | if (!strnicmp(buf, "dma", 3)) { |
438 | buf += 3; | 441 | buf += 3; |
439 | while (isspace(*buf)) | 442 | while (isspace(*buf)) |
440 | ++buf; | 443 | ++buf; |
441 | res = &dev->res.dma_resource[ndma]; | 444 | res = pnp_get_resource(dev, IORESOURCE_DMA, |
445 | ndma); | ||
446 | if (!res) | ||
447 | break; | ||
442 | res->start = res->end = | 448 | res->start = res->end = |
443 | simple_strtoul(buf, &buf, 0); | 449 | simple_strtoul(buf, &buf, 0); |
444 | res->flags = IORESOURCE_DMA; | 450 | res->flags = IORESOURCE_DMA; |
445 | ndma++; | 451 | ndma++; |
446 | if (ndma >= PNP_MAX_DMA) | ||
447 | break; | ||
448 | continue; | 452 | continue; |
449 | } | 453 | } |
450 | break; | 454 | break; |