aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/pnpacpi/rsparser.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-28 18:34:24 -0400
committerLen Brown <len.brown@intel.com>2008-04-29 03:22:26 -0400
commit7e2cf31f1c97ac14b6d9dc5f1ce9e1e01aef9c18 (patch)
treea69361060c5bd7a2d4ca6f8d91ff09248d7dee7b /drivers/pnp/pnpacpi/rsparser.c
parentbe81b4a4838ce329b9f3978c7fc007b047c23722 (diff)
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/rsparser.c')
-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,
1014 1014
1015int pnpacpi_encode_resources(struct pnp_dev *dev, struct acpi_buffer *buffer) 1015int pnpacpi_encode_resources(struct pnp_dev *dev, struct acpi_buffer *buffer)
1016{ 1016{
1017 struct pnp_resource_table *res_table = &dev->res;
1018 int i = 0; 1017 int i = 0;
1019 /* pnpacpi_build_resource_template allocates extra mem */ 1018 /* pnpacpi_build_resource_template allocates extra mem */
1020 int res_cnt = (buffer->length - 1) / sizeof(struct acpi_resource) - 1; 1019 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)
1026 switch (resource->type) { 1025 switch (resource->type) {
1027 case ACPI_RESOURCE_TYPE_IRQ: 1026 case ACPI_RESOURCE_TYPE_IRQ:
1028 pnpacpi_encode_irq(dev, resource, 1027 pnpacpi_encode_irq(dev, resource,
1029 &res_table->irq_resource[irq]); 1028 pnp_get_resource(dev, IORESOURCE_IRQ, irq));
1030 irq++; 1029 irq++;
1031 break; 1030 break;
1032 1031
1033 case ACPI_RESOURCE_TYPE_DMA: 1032 case ACPI_RESOURCE_TYPE_DMA:
1034 pnpacpi_encode_dma(dev, resource, 1033 pnpacpi_encode_dma(dev, resource,
1035 &res_table->dma_resource[dma]); 1034 pnp_get_resource(dev, IORESOURCE_DMA, dma));
1036 dma++; 1035 dma++;
1037 break; 1036 break;
1038 case ACPI_RESOURCE_TYPE_IO: 1037 case ACPI_RESOURCE_TYPE_IO:
1039 pnpacpi_encode_io(dev, resource, 1038 pnpacpi_encode_io(dev, resource,
1040 &res_table->port_resource[port]); 1039 pnp_get_resource(dev, IORESOURCE_IO, port));
1041 port++; 1040 port++;
1042 break; 1041 break;
1043 case ACPI_RESOURCE_TYPE_FIXED_IO: 1042 case ACPI_RESOURCE_TYPE_FIXED_IO:
1044 pnpacpi_encode_fixed_io(dev, resource, 1043 pnpacpi_encode_fixed_io(dev, resource,
1045 &res_table-> 1044 pnp_get_resource(dev, IORESOURCE_IO, port));
1046 port_resource[port]);
1047 port++; 1045 port++;
1048 break; 1046 break;
1049 case ACPI_RESOURCE_TYPE_MEMORY24: 1047 case ACPI_RESOURCE_TYPE_MEMORY24:
1050 pnpacpi_encode_mem24(dev, resource, 1048 pnpacpi_encode_mem24(dev, resource,
1051 &res_table->mem_resource[mem]); 1049 pnp_get_resource(dev, IORESOURCE_MEM, mem));
1052 mem++; 1050 mem++;
1053 break; 1051 break;
1054 case ACPI_RESOURCE_TYPE_MEMORY32: 1052 case ACPI_RESOURCE_TYPE_MEMORY32:
1055 pnpacpi_encode_mem32(dev, resource, 1053 pnpacpi_encode_mem32(dev, resource,
1056 &res_table->mem_resource[mem]); 1054 pnp_get_resource(dev, IORESOURCE_MEM, mem));
1057 mem++; 1055 mem++;
1058 break; 1056 break;
1059 case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: 1057 case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
1060 pnpacpi_encode_fixed_mem32(dev, resource, 1058 pnpacpi_encode_fixed_mem32(dev, resource,
1061 &res_table-> 1059 pnp_get_resource(dev, IORESOURCE_MEM, mem));
1062 mem_resource[mem]);
1063 mem++; 1060 mem++;
1064 break; 1061 break;
1065 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: 1062 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
1066 pnpacpi_encode_ext_irq(dev, resource, 1063 pnpacpi_encode_ext_irq(dev, resource,
1067 &res_table->irq_resource[irq]); 1064 pnp_get_resource(dev, IORESOURCE_IRQ, irq));
1068 irq++; 1065 irq++;
1069 break; 1066 break;
1070 case ACPI_RESOURCE_TYPE_START_DEPENDENT: 1067 case ACPI_RESOURCE_TYPE_START_DEPENDENT: