aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/pnpacpi/rsparser.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp/pnpacpi/rsparser.c')
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index c6c552f681b7..100e4d9372f1 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -280,6 +280,7 @@ static void pnpacpi_parse_allocated_address_space(struct pnp_dev *dev,
280 struct acpi_resource_address64 addr, *p = &addr; 280 struct acpi_resource_address64 addr, *p = &addr;
281 acpi_status status; 281 acpi_status status;
282 int window; 282 int window;
283 u64 len;
283 284
284 status = acpi_resource_to_address64(res, p); 285 status = acpi_resource_to_address64(res, p);
285 if (!ACPI_SUCCESS(status)) { 286 if (!ACPI_SUCCESS(status)) {
@@ -288,20 +289,19 @@ static void pnpacpi_parse_allocated_address_space(struct pnp_dev *dev,
288 return; 289 return;
289 } 290 }
290 291
292 /* Windows apparently computes length rather than using _LEN */
293 len = p->maximum - p->minimum + 1;
291 window = (p->producer_consumer == ACPI_PRODUCER) ? 1 : 0; 294 window = (p->producer_consumer == ACPI_PRODUCER) ? 1 : 0;
292 295
293 if (p->resource_type == ACPI_MEMORY_RANGE) 296 if (p->resource_type == ACPI_MEMORY_RANGE)
294 pnpacpi_parse_allocated_memresource(dev, 297 pnpacpi_parse_allocated_memresource(dev, p->minimum, len,
295 p->minimum, p->address_length,
296 p->info.mem.write_protect, window); 298 p->info.mem.write_protect, window);
297 else if (p->resource_type == ACPI_IO_RANGE) 299 else if (p->resource_type == ACPI_IO_RANGE)
298 pnpacpi_parse_allocated_ioresource(dev, 300 pnpacpi_parse_allocated_ioresource(dev, p->minimum, len,
299 p->minimum, p->address_length,
300 p->granularity == 0xfff ? ACPI_DECODE_10 : 301 p->granularity == 0xfff ? ACPI_DECODE_10 :
301 ACPI_DECODE_16, window); 302 ACPI_DECODE_16, window);
302 else if (p->resource_type == ACPI_BUS_NUMBER_RANGE) 303 else if (p->resource_type == ACPI_BUS_NUMBER_RANGE)
303 pnpacpi_parse_allocated_busresource(dev, p->minimum, 304 pnpacpi_parse_allocated_busresource(dev, p->minimum, len);
304 p->address_length);
305} 305}
306 306
307static void pnpacpi_parse_allocated_ext_address_space(struct pnp_dev *dev, 307static void pnpacpi_parse_allocated_ext_address_space(struct pnp_dev *dev,
@@ -309,21 +309,21 @@ static void pnpacpi_parse_allocated_ext_address_space(struct pnp_dev *dev,
309{ 309{
310 struct acpi_resource_extended_address64 *p = &res->data.ext_address64; 310 struct acpi_resource_extended_address64 *p = &res->data.ext_address64;
311 int window; 311 int window;
312 u64 len;
312 313
314 /* Windows apparently computes length rather than using _LEN */
315 len = p->maximum - p->minimum + 1;
313 window = (p->producer_consumer == ACPI_PRODUCER) ? 1 : 0; 316 window = (p->producer_consumer == ACPI_PRODUCER) ? 1 : 0;
314 317
315 if (p->resource_type == ACPI_MEMORY_RANGE) 318 if (p->resource_type == ACPI_MEMORY_RANGE)
316 pnpacpi_parse_allocated_memresource(dev, 319 pnpacpi_parse_allocated_memresource(dev, p->minimum, len,
317 p->minimum, p->address_length,
318 p->info.mem.write_protect, window); 320 p->info.mem.write_protect, window);
319 else if (p->resource_type == ACPI_IO_RANGE) 321 else if (p->resource_type == ACPI_IO_RANGE)
320 pnpacpi_parse_allocated_ioresource(dev, 322 pnpacpi_parse_allocated_ioresource(dev, p->minimum, len,
321 p->minimum, p->address_length,
322 p->granularity == 0xfff ? ACPI_DECODE_10 : 323 p->granularity == 0xfff ? ACPI_DECODE_10 :
323 ACPI_DECODE_16, window); 324 ACPI_DECODE_16, window);
324 else if (p->resource_type == ACPI_BUS_NUMBER_RANGE) 325 else if (p->resource_type == ACPI_BUS_NUMBER_RANGE)
325 pnpacpi_parse_allocated_busresource(dev, p->minimum, 326 pnpacpi_parse_allocated_busresource(dev, p->minimum, len);
326 p->address_length);
327} 327}
328 328
329static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, 329static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,