summaryrefslogtreecommitdiff
path: root/drivers/pnp/pnpacpi
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-28 16:34:24 -0600
committerLen Brown <len.brown@intel.com>2008-04-29 03:22:26 -0400
commit7e2cf31f1c97ac14b6d9dc5f1ce9e1e01aef9c18 (patch)
treea69361060c5bd7a2d4ca6f8d91ff09248d7dee7b /drivers/pnp/pnpacpi
parentbe81b4a4838ce329b9f3978c7fc007b047c23722 (diff)
downloadlwn-7e2cf31f1c97ac14b6d9dc5f1ce9e1e01aef9c18.tar.gz
lwn-7e2cf31f1c97ac14b6d9dc5f1ce9e1e01aef9c18.zip
PNP: convert encoders to use pnp_get_resource(), not pnp_resource_table
This removes more direct references to pnp_resource_table. This path is used when telling a device what resources it should use. This doesn't convert ISAPNP because ISA needs to know the config register index in addition to the resource itself. 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/pnpacpi')
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index bd41e4d4270c..000a1b39f0b6 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -1014,7 +1014,6 @@ static void pnpacpi_encode_fixed_mem32(struct pnp_dev *dev,
int pnpacpi_encode_resources(struct pnp_dev *dev, struct acpi_buffer *buffer)
{
- struct pnp_resource_table *res_table = &dev->res;
int i = 0;
/* pnpacpi_build_resource_template allocates extra mem */
int res_cnt = (buffer->length - 1) / sizeof(struct acpi_resource) - 1;
@@ -1026,45 +1025,43 @@ int pnpacpi_encode_resources(struct pnp_dev *dev, struct acpi_buffer *buffer)
switch (resource->type) {
case ACPI_RESOURCE_TYPE_IRQ:
pnpacpi_encode_irq(dev, resource,
- &res_table->irq_resource[irq]);
+ pnp_get_resource(dev, IORESOURCE_IRQ, irq));
irq++;
break;
case ACPI_RESOURCE_TYPE_DMA:
pnpacpi_encode_dma(dev, resource,
- &res_table->dma_resource[dma]);
+ pnp_get_resource(dev, IORESOURCE_DMA, dma));
dma++;
break;
case ACPI_RESOURCE_TYPE_IO:
pnpacpi_encode_io(dev, resource,
- &res_table->port_resource[port]);
+ pnp_get_resource(dev, IORESOURCE_IO, port));
port++;
break;
case ACPI_RESOURCE_TYPE_FIXED_IO:
pnpacpi_encode_fixed_io(dev, resource,
- &res_table->
- port_resource[port]);
+ pnp_get_resource(dev, IORESOURCE_IO, port));
port++;
break;
case ACPI_RESOURCE_TYPE_MEMORY24:
pnpacpi_encode_mem24(dev, resource,
- &res_table->mem_resource[mem]);
+ pnp_get_resource(dev, IORESOURCE_MEM, mem));
mem++;
break;
case ACPI_RESOURCE_TYPE_MEMORY32:
pnpacpi_encode_mem32(dev, resource,
- &res_table->mem_resource[mem]);
+ pnp_get_resource(dev, IORESOURCE_MEM, mem));
mem++;
break;
case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
pnpacpi_encode_fixed_mem32(dev, resource,
- &res_table->
- mem_resource[mem]);
+ pnp_get_resource(dev, IORESOURCE_MEM, mem));
mem++;
break;
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
pnpacpi_encode_ext_irq(dev, resource,
- &res_table->irq_resource[irq]);
+ pnp_get_resource(dev, IORESOURCE_IRQ, irq));
irq++;
break;
case ACPI_RESOURCE_TYPE_START_DEPENDENT: