diff options
Diffstat (limited to 'drivers/pnp/pnpacpi/rsparser.c')
-rw-r--r-- | drivers/pnp/pnpacpi/rsparser.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index 66977ebf13b3..ff0356fb378f 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c | |||
@@ -180,20 +180,21 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, | |||
180 | struct pnp_dev *dev = data; | 180 | struct pnp_dev *dev = data; |
181 | struct acpi_resource_dma *dma; | 181 | struct acpi_resource_dma *dma; |
182 | struct acpi_resource_vendor_typed *vendor_typed; | 182 | struct acpi_resource_vendor_typed *vendor_typed; |
183 | struct resource r = {0}; | 183 | struct resource_win win = {{0}, 0}; |
184 | struct resource *r = &win.res; | ||
184 | int i, flags; | 185 | int i, flags; |
185 | 186 | ||
186 | if (acpi_dev_resource_address_space(res, &r) | 187 | if (acpi_dev_resource_address_space(res, &win) |
187 | || acpi_dev_resource_ext_address_space(res, &r)) { | 188 | || acpi_dev_resource_ext_address_space(res, &win)) { |
188 | pnp_add_resource(dev, &r); | 189 | pnp_add_resource(dev, &win.res); |
189 | return AE_OK; | 190 | return AE_OK; |
190 | } | 191 | } |
191 | 192 | ||
192 | r.flags = 0; | 193 | r->flags = 0; |
193 | if (acpi_dev_resource_interrupt(res, 0, &r)) { | 194 | if (acpi_dev_resource_interrupt(res, 0, r)) { |
194 | pnpacpi_add_irqresource(dev, &r); | 195 | pnpacpi_add_irqresource(dev, r); |
195 | for (i = 1; acpi_dev_resource_interrupt(res, i, &r); i++) | 196 | for (i = 1; acpi_dev_resource_interrupt(res, i, r); i++) |
196 | pnpacpi_add_irqresource(dev, &r); | 197 | pnpacpi_add_irqresource(dev, r); |
197 | 198 | ||
198 | if (i > 1) { | 199 | if (i > 1) { |
199 | /* | 200 | /* |
@@ -209,7 +210,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, | |||
209 | } | 210 | } |
210 | } | 211 | } |
211 | return AE_OK; | 212 | return AE_OK; |
212 | } else if (r.flags & IORESOURCE_DISABLED) { | 213 | } else if (r->flags & IORESOURCE_DISABLED) { |
213 | pnp_add_irq_resource(dev, 0, IORESOURCE_DISABLED); | 214 | pnp_add_irq_resource(dev, 0, IORESOURCE_DISABLED); |
214 | return AE_OK; | 215 | return AE_OK; |
215 | } | 216 | } |
@@ -218,13 +219,13 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, | |||
218 | case ACPI_RESOURCE_TYPE_MEMORY24: | 219 | case ACPI_RESOURCE_TYPE_MEMORY24: |
219 | case ACPI_RESOURCE_TYPE_MEMORY32: | 220 | case ACPI_RESOURCE_TYPE_MEMORY32: |
220 | case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: | 221 | case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: |
221 | if (acpi_dev_resource_memory(res, &r)) | 222 | if (acpi_dev_resource_memory(res, r)) |
222 | pnp_add_resource(dev, &r); | 223 | pnp_add_resource(dev, r); |
223 | break; | 224 | break; |
224 | case ACPI_RESOURCE_TYPE_IO: | 225 | case ACPI_RESOURCE_TYPE_IO: |
225 | case ACPI_RESOURCE_TYPE_FIXED_IO: | 226 | case ACPI_RESOURCE_TYPE_FIXED_IO: |
226 | if (acpi_dev_resource_io(res, &r)) | 227 | if (acpi_dev_resource_io(res, r)) |
227 | pnp_add_resource(dev, &r); | 228 | pnp_add_resource(dev, r); |
228 | break; | 229 | break; |
229 | case ACPI_RESOURCE_TYPE_DMA: | 230 | case ACPI_RESOURCE_TYPE_DMA: |
230 | dma = &res->data.dma; | 231 | dma = &res->data.dma; |
@@ -410,12 +411,12 @@ static __init void pnpacpi_parse_address_option(struct pnp_dev *dev, | |||
410 | if (p->resource_type == ACPI_MEMORY_RANGE) { | 411 | if (p->resource_type == ACPI_MEMORY_RANGE) { |
411 | if (p->info.mem.write_protect == ACPI_READ_WRITE_MEMORY) | 412 | if (p->info.mem.write_protect == ACPI_READ_WRITE_MEMORY) |
412 | flags = IORESOURCE_MEM_WRITEABLE; | 413 | flags = IORESOURCE_MEM_WRITEABLE; |
413 | pnp_register_mem_resource(dev, option_flags, p->minimum, | 414 | pnp_register_mem_resource(dev, option_flags, p->address.minimum, |
414 | p->minimum, 0, p->address_length, | 415 | p->address.minimum, 0, p->address.address_length, |
415 | flags); | 416 | flags); |
416 | } else if (p->resource_type == ACPI_IO_RANGE) | 417 | } else if (p->resource_type == ACPI_IO_RANGE) |
417 | pnp_register_port_resource(dev, option_flags, p->minimum, | 418 | pnp_register_port_resource(dev, option_flags, p->address.minimum, |
418 | p->minimum, 0, p->address_length, | 419 | p->address.minimum, 0, p->address.address_length, |
419 | IORESOURCE_IO_FIXED); | 420 | IORESOURCE_IO_FIXED); |
420 | } | 421 | } |
421 | 422 | ||
@@ -429,12 +430,12 @@ static __init void pnpacpi_parse_ext_address_option(struct pnp_dev *dev, | |||
429 | if (p->resource_type == ACPI_MEMORY_RANGE) { | 430 | if (p->resource_type == ACPI_MEMORY_RANGE) { |
430 | if (p->info.mem.write_protect == ACPI_READ_WRITE_MEMORY) | 431 | if (p->info.mem.write_protect == ACPI_READ_WRITE_MEMORY) |
431 | flags = IORESOURCE_MEM_WRITEABLE; | 432 | flags = IORESOURCE_MEM_WRITEABLE; |
432 | pnp_register_mem_resource(dev, option_flags, p->minimum, | 433 | pnp_register_mem_resource(dev, option_flags, p->address.minimum, |
433 | p->minimum, 0, p->address_length, | 434 | p->address.minimum, 0, p->address.address_length, |
434 | flags); | 435 | flags); |
435 | } else if (p->resource_type == ACPI_IO_RANGE) | 436 | } else if (p->resource_type == ACPI_IO_RANGE) |
436 | pnp_register_port_resource(dev, option_flags, p->minimum, | 437 | pnp_register_port_resource(dev, option_flags, p->address.minimum, |
437 | p->minimum, 0, p->address_length, | 438 | p->address.minimum, 0, p->address.address_length, |
438 | IORESOURCE_IO_FIXED); | 439 | IORESOURCE_IO_FIXED); |
439 | } | 440 | } |
440 | 441 | ||