diff options
-rw-r--r-- | drivers/acpi/apei/einj.c | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c index 4ba41855799f..eebb7e39c49c 100644 --- a/drivers/acpi/apei/einj.c +++ b/drivers/acpi/apei/einj.c | |||
@@ -692,34 +692,42 @@ static int __init einj_init(void) | |||
692 | struct dentry *fentry; | 692 | struct dentry *fentry; |
693 | struct apei_exec_context ctx; | 693 | struct apei_exec_context ctx; |
694 | 694 | ||
695 | if (acpi_disabled) | 695 | if (acpi_disabled) { |
696 | pr_warn("ACPI disabled.\n"); | ||
696 | return -ENODEV; | 697 | return -ENODEV; |
698 | } | ||
697 | 699 | ||
698 | status = acpi_get_table(ACPI_SIG_EINJ, 0, | 700 | status = acpi_get_table(ACPI_SIG_EINJ, 0, |
699 | (struct acpi_table_header **)&einj_tab); | 701 | (struct acpi_table_header **)&einj_tab); |
700 | if (status == AE_NOT_FOUND) | 702 | if (status == AE_NOT_FOUND) { |
703 | pr_warn("EINJ table not found.\n"); | ||
701 | return -ENODEV; | 704 | return -ENODEV; |
705 | } | ||
702 | else if (ACPI_FAILURE(status)) { | 706 | else if (ACPI_FAILURE(status)) { |
703 | const char *msg = acpi_format_exception(status); | 707 | pr_err("Failed to get EINJ table: %s\n", |
704 | pr_err("Failed to get table, %s\n", msg); | 708 | acpi_format_exception(status)); |
705 | return -EINVAL; | 709 | return -EINVAL; |
706 | } | 710 | } |
707 | 711 | ||
708 | rc = einj_check_table(einj_tab); | 712 | rc = einj_check_table(einj_tab); |
709 | if (rc) { | 713 | if (rc) { |
710 | pr_warning(FW_BUG "EINJ table is invalid\n"); | 714 | pr_warn(FW_BUG "Invalid EINJ table.n"); |
711 | return -EINVAL; | 715 | return -EINVAL; |
712 | } | 716 | } |
713 | 717 | ||
714 | rc = -ENOMEM; | 718 | rc = -ENOMEM; |
715 | einj_debug_dir = debugfs_create_dir("einj", apei_get_debugfs_dir()); | 719 | einj_debug_dir = debugfs_create_dir("einj", apei_get_debugfs_dir()); |
716 | if (!einj_debug_dir) | 720 | if (!einj_debug_dir) { |
721 | pr_err("Error creating debugfs node.\n"); | ||
717 | goto err_cleanup; | 722 | goto err_cleanup; |
723 | } | ||
724 | |||
718 | fentry = debugfs_create_file("available_error_type", S_IRUSR, | 725 | fentry = debugfs_create_file("available_error_type", S_IRUSR, |
719 | einj_debug_dir, NULL, | 726 | einj_debug_dir, NULL, |
720 | &available_error_type_fops); | 727 | &available_error_type_fops); |
721 | if (!fentry) | 728 | if (!fentry) |
722 | goto err_cleanup; | 729 | goto err_cleanup; |
730 | |||
723 | fentry = debugfs_create_file("error_type", S_IRUSR | S_IWUSR, | 731 | fentry = debugfs_create_file("error_type", S_IRUSR | S_IWUSR, |
724 | einj_debug_dir, NULL, &error_type_fops); | 732 | einj_debug_dir, NULL, &error_type_fops); |
725 | if (!fentry) | 733 | if (!fentry) |
@@ -732,14 +740,22 @@ static int __init einj_init(void) | |||
732 | apei_resources_init(&einj_resources); | 740 | apei_resources_init(&einj_resources); |
733 | einj_exec_ctx_init(&ctx); | 741 | einj_exec_ctx_init(&ctx); |
734 | rc = apei_exec_collect_resources(&ctx, &einj_resources); | 742 | rc = apei_exec_collect_resources(&ctx, &einj_resources); |
735 | if (rc) | 743 | if (rc) { |
744 | pr_err("Error collecting EINJ resources.\n"); | ||
736 | goto err_fini; | 745 | goto err_fini; |
746 | } | ||
747 | |||
737 | rc = apei_resources_request(&einj_resources, "APEI EINJ"); | 748 | rc = apei_resources_request(&einj_resources, "APEI EINJ"); |
738 | if (rc) | 749 | if (rc) { |
750 | pr_err("Error requesting memory/port resources.\n"); | ||
739 | goto err_fini; | 751 | goto err_fini; |
752 | } | ||
753 | |||
740 | rc = apei_exec_pre_map_gars(&ctx); | 754 | rc = apei_exec_pre_map_gars(&ctx); |
741 | if (rc) | 755 | if (rc) { |
756 | pr_err("Error pre-mapping GARs.\n"); | ||
742 | goto err_release; | 757 | goto err_release; |
758 | } | ||
743 | 759 | ||
744 | rc = -ENOMEM; | 760 | rc = -ENOMEM; |
745 | einj_param = einj_get_parameter_address(); | 761 | einj_param = einj_get_parameter_address(); |
@@ -795,6 +811,7 @@ err_unmap: | |||
795 | sizeof(struct einj_parameter); | 811 | sizeof(struct einj_parameter); |
796 | 812 | ||
797 | acpi_os_unmap_iomem(einj_param, size); | 813 | acpi_os_unmap_iomem(einj_param, size); |
814 | pr_err("Error creating param extension debugfs nodes.\n"); | ||
798 | } | 815 | } |
799 | apei_exec_post_unmap_gars(&ctx); | 816 | apei_exec_post_unmap_gars(&ctx); |
800 | err_release: | 817 | err_release: |
@@ -802,6 +819,7 @@ err_release: | |||
802 | err_fini: | 819 | err_fini: |
803 | apei_resources_fini(&einj_resources); | 820 | apei_resources_fini(&einj_resources); |
804 | err_cleanup: | 821 | err_cleanup: |
822 | pr_err("Error creating primary debugfs nodes.\n"); | ||
805 | debugfs_remove_recursive(einj_debug_dir); | 823 | debugfs_remove_recursive(einj_debug_dir); |
806 | 824 | ||
807 | return rc; | 825 | return rc; |