summary refs log tree commit diff
path: root/drivers/acpi/acpica/evgpeutil.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-01-12 23:45:43 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-01-12 23:45:43 +0100
commit3e7cc142c1e040fd4629ad34a54b1c5b46dc3dd3 (patch)
treebbb7a1e440caa0df16da2b05d6a443a752b8b171 /drivers/acpi/acpica/evgpeutil.c
parent25d412d932fb3289ae5b510845d523330b80bb71 (diff)
parentc14ced0464bf5ef3a3fad6d69bbf07c80bfbaf5b (diff)
downloadlinux-3e7cc142c1e040fd4629ad34a54b1c5b46dc3dd3.tar.gz
Merge branch 'acpica'
* acpica: (21 commits)
  ACPICA: Update version to 20131218.
  ACPICA: Utilities: Cleanup declarations of the acpi_gbl_debug_file global.
  ACPICA: Linuxize: Cleanup spaces after special macro invocations.
  ACPICA: Interpreter: Add additional debug info for an error case.
  ACPICA: Update ACPI example code to make it an actual working program.
  ACPICA: Add an error message if the Debugger fails initialization.
  ACPICA: Conditionally define a local variable that is used for debug only.
  ACPICA: Parser: Updates/fixes for debug output.
  ACPICA: Enhance ACPI warning for memory/IO address conflicts.
  ACPICA: Update several debug statements - no functional change.
  ACPICA: Improve exception handling for GPE block installation.
  ACPICA: Add helper macros to extract bus/segment numbers from HEST table.
  ACPICA: Tables: Add full support for the PCCT table, update table definition.
  ACPICA: Tables: Add full support for the DBG2 table.
  ACPICA: Add option to favor 32-bit FADT addresses.
  ACPICA: Cleanup the option of forcing the use of the RSDT.
  ACPICA: Back port and refine validation of the XSDT root table.
  ACPICA: Linux Header: Remove unused OSL prototypes.
  ACPICA: Remove unused ACPI_FREE_BUFFER macro. No functional change.
  ACPICA: Disassembler: Improve pathname support for emitted External() statements.
  ...
Diffstat (limited to 'drivers/acpi/acpica/evgpeutil.c')
-rw-r--r--drivers/acpi/acpica/evgpeutil.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/acpi/acpica/evgpeutil.c b/drivers/acpi/acpica/evgpeutil.c
index d3f5e1e2a2b1..4d764e847a08 100644
--- a/drivers/acpi/acpica/evgpeutil.c
+++ b/drivers/acpi/acpica/evgpeutil.c
@@ -197,8 +197,9 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  * FUNCTION:    acpi_ev_get_gpe_xrupt_block
  *
  * PARAMETERS:  interrupt_number            - Interrupt for a GPE block
+ *              gpe_xrupt_block             - Where the block is returned
  *
- * RETURN:      A GPE interrupt block
+ * RETURN:      Status
  *
  * DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt
  *              block per unique interrupt level used for GPEs. Should be
@@ -207,7 +208,9 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  *
  ******************************************************************************/
 
-struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number)
+acpi_status
+acpi_ev_get_gpe_xrupt_block(u32 interrupt_number,
+			    struct acpi_gpe_xrupt_info ** gpe_xrupt_block)
 {
 	struct acpi_gpe_xrupt_info *next_gpe_xrupt;
 	struct acpi_gpe_xrupt_info *gpe_xrupt;
@@ -221,7 +224,8 @@ struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number)
 	next_gpe_xrupt = acpi_gbl_gpe_xrupt_list_head;
 	while (next_gpe_xrupt) {
 		if (next_gpe_xrupt->interrupt_number == interrupt_number) {
-			return_PTR(next_gpe_xrupt);
+			*gpe_xrupt_block = next_gpe_xrupt;
+			return_ACPI_STATUS(AE_OK);
 		}
 
 		next_gpe_xrupt = next_gpe_xrupt->next;
@@ -231,7 +235,7 @@ struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number)
 
 	gpe_xrupt = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_xrupt_info));
 	if (!gpe_xrupt) {
-		return_PTR(NULL);
+		return_ACPI_STATUS(AE_NO_MEMORY);
 	}
 
 	gpe_xrupt->interrupt_number = interrupt_number;
@@ -250,6 +254,7 @@ struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number)
 	} else {
 		acpi_gbl_gpe_xrupt_list_head = gpe_xrupt;
 	}
+
 	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
 
 	/* Install new interrupt handler if not SCI_INT */
@@ -259,14 +264,15 @@ struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number)
 							   acpi_ev_gpe_xrupt_handler,
 							   gpe_xrupt);
 		if (ACPI_FAILURE(status)) {
-			ACPI_ERROR((AE_INFO,
-				    "Could not install GPE interrupt handler at level 0x%X",
-				    interrupt_number));
-			return_PTR(NULL);
+			ACPI_EXCEPTION((AE_INFO, status,
+					"Could not install GPE interrupt handler at level 0x%X",
+					interrupt_number));
+			return_ACPI_STATUS(status);
 		}
 	}
 
-	return_PTR(gpe_xrupt);
+	*gpe_xrupt_block = gpe_xrupt;
+	return_ACPI_STATUS(AE_OK);
 }
 
 /*******************************************************************************