diff options
Diffstat (limited to 'drivers/pnp/pnpacpi/rsparser.c')
-rw-r--r-- | drivers/pnp/pnpacpi/rsparser.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index a512908bf4e3..0201c8adfda7 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c | |||
@@ -339,16 +339,24 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, | |||
339 | return AE_OK; | 339 | return AE_OK; |
340 | } | 340 | } |
341 | 341 | ||
342 | acpi_status pnpacpi_parse_allocated_resource(struct pnp_dev *dev) | 342 | int pnpacpi_parse_allocated_resource(struct pnp_dev *dev) |
343 | { | 343 | { |
344 | acpi_handle handle = dev->data; | 344 | acpi_handle handle = dev->data; |
345 | acpi_status status; | ||
345 | 346 | ||
346 | dev_dbg(&dev->dev, "parse allocated resources\n"); | 347 | dev_dbg(&dev->dev, "parse allocated resources\n"); |
347 | 348 | ||
348 | pnp_init_resources(dev); | 349 | pnp_init_resources(dev); |
349 | 350 | ||
350 | return acpi_walk_resources(handle, METHOD_NAME__CRS, | 351 | status = acpi_walk_resources(handle, METHOD_NAME__CRS, |
351 | pnpacpi_allocated_resource, dev); | 352 | pnpacpi_allocated_resource, dev); |
353 | |||
354 | if (ACPI_FAILURE(status)) { | ||
355 | if (status != AE_NOT_FOUND) | ||
356 | dev_err(&dev->dev, "can't evaluate _CRS: %d", status); | ||
357 | return -EPERM; | ||
358 | } | ||
359 | return 0; | ||
352 | } | 360 | } |
353 | 361 | ||
354 | static __init void pnpacpi_parse_dma_option(struct pnp_dev *dev, | 362 | static __init void pnpacpi_parse_dma_option(struct pnp_dev *dev, |
@@ -670,7 +678,7 @@ static __init acpi_status pnpacpi_option_resource(struct acpi_resource *res, | |||
670 | return AE_OK; | 678 | return AE_OK; |
671 | } | 679 | } |
672 | 680 | ||
673 | acpi_status __init pnpacpi_parse_resource_option_data(struct pnp_dev *dev) | 681 | int __init pnpacpi_parse_resource_option_data(struct pnp_dev *dev) |
674 | { | 682 | { |
675 | acpi_handle handle = dev->data; | 683 | acpi_handle handle = dev->data; |
676 | acpi_status status; | 684 | acpi_status status; |
@@ -680,13 +688,19 @@ acpi_status __init pnpacpi_parse_resource_option_data(struct pnp_dev *dev) | |||
680 | 688 | ||
681 | parse_data.option = pnp_register_independent_option(dev); | 689 | parse_data.option = pnp_register_independent_option(dev); |
682 | if (!parse_data.option) | 690 | if (!parse_data.option) |
683 | return AE_ERROR; | 691 | return -ENOMEM; |
692 | |||
684 | parse_data.option_independent = parse_data.option; | 693 | parse_data.option_independent = parse_data.option; |
685 | parse_data.dev = dev; | 694 | parse_data.dev = dev; |
686 | status = acpi_walk_resources(handle, METHOD_NAME__PRS, | 695 | status = acpi_walk_resources(handle, METHOD_NAME__PRS, |
687 | pnpacpi_option_resource, &parse_data); | 696 | pnpacpi_option_resource, &parse_data); |
688 | 697 | ||
689 | return status; | 698 | if (ACPI_FAILURE(status)) { |
699 | if (status != AE_NOT_FOUND) | ||
700 | dev_err(&dev->dev, "can't evaluate _PRS: %d", status); | ||
701 | return -EPERM; | ||
702 | } | ||
703 | return 0; | ||
690 | } | 704 | } |
691 | 705 | ||
692 | static int pnpacpi_supported_resource(struct acpi_resource *res) | 706 | static int pnpacpi_supported_resource(struct acpi_resource *res) |
@@ -745,7 +759,7 @@ int pnpacpi_build_resource_template(struct pnp_dev *dev, | |||
745 | status = acpi_walk_resources(handle, METHOD_NAME__CRS, | 759 | status = acpi_walk_resources(handle, METHOD_NAME__CRS, |
746 | pnpacpi_count_resources, &res_cnt); | 760 | pnpacpi_count_resources, &res_cnt); |
747 | if (ACPI_FAILURE(status)) { | 761 | if (ACPI_FAILURE(status)) { |
748 | dev_err(&dev->dev, "can't evaluate _CRS\n"); | 762 | dev_err(&dev->dev, "can't evaluate _CRS: %d\n", status); |
749 | return -EINVAL; | 763 | return -EINVAL; |
750 | } | 764 | } |
751 | if (!res_cnt) | 765 | if (!res_cnt) |
@@ -760,7 +774,7 @@ int pnpacpi_build_resource_template(struct pnp_dev *dev, | |||
760 | pnpacpi_type_resources, &resource); | 774 | pnpacpi_type_resources, &resource); |
761 | if (ACPI_FAILURE(status)) { | 775 | if (ACPI_FAILURE(status)) { |
762 | kfree(buffer->pointer); | 776 | kfree(buffer->pointer); |
763 | dev_err(&dev->dev, "can't evaluate _CRS\n"); | 777 | dev_err(&dev->dev, "can't evaluate _CRS: %d\n", status); |
764 | return -EINVAL; | 778 | return -EINVAL; |
765 | } | 779 | } |
766 | /* resource will pointer the end resource now */ | 780 | /* resource will pointer the end resource now */ |