diff options
-rw-r--r-- | drivers/acpi/acpica/acevents.h | 4 | ||||
-rw-r--r-- | drivers/acpi/acpica/evgpeblk.c | 8 | ||||
-rw-r--r-- | drivers/acpi/acpica/evgpeutil.c | 24 |
3 files changed, 22 insertions, 14 deletions
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h index 41abe552c7a3..073830512d84 100644 --- a/drivers/acpi/acpica/acevents.h +++ b/drivers/acpi/acpica/acevents.h | |||
@@ -149,7 +149,9 @@ acpi_status | |||
149 | acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info, | 149 | acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info, |
150 | struct acpi_gpe_block_info *gpe_block, void *context); | 150 | struct acpi_gpe_block_info *gpe_block, void *context); |
151 | 151 | ||
152 | struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number); | 152 | acpi_status |
153 | acpi_ev_get_gpe_xrupt_block(u32 interrupt_number, | ||
154 | struct acpi_gpe_xrupt_info **gpe_xrupt_block); | ||
153 | 155 | ||
154 | acpi_status acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt); | 156 | acpi_status acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt); |
155 | 157 | ||
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c index a9e76bc4ad97..a31e549e64cc 100644 --- a/drivers/acpi/acpica/evgpeblk.c +++ b/drivers/acpi/acpica/evgpeblk.c | |||
@@ -87,9 +87,9 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block, | |||
87 | return_ACPI_STATUS(status); | 87 | return_ACPI_STATUS(status); |
88 | } | 88 | } |
89 | 89 | ||
90 | gpe_xrupt_block = acpi_ev_get_gpe_xrupt_block(interrupt_number); | 90 | status = |
91 | if (!gpe_xrupt_block) { | 91 | acpi_ev_get_gpe_xrupt_block(interrupt_number, &gpe_xrupt_block); |
92 | status = AE_NO_MEMORY; | 92 | if (ACPI_FAILURE(status)) { |
93 | goto unlock_and_exit; | 93 | goto unlock_and_exit; |
94 | } | 94 | } |
95 | 95 | ||
@@ -112,7 +112,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block, | |||
112 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); | 112 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); |
113 | 113 | ||
114 | unlock_and_exit: | 114 | unlock_and_exit: |
115 | status = acpi_ut_release_mutex(ACPI_MTX_EVENTS); | 115 | (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); |
116 | return_ACPI_STATUS(status); | 116 | return_ACPI_STATUS(status); |
117 | } | 117 | } |
118 | 118 | ||
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, | |||
197 | * FUNCTION: acpi_ev_get_gpe_xrupt_block | 197 | * FUNCTION: acpi_ev_get_gpe_xrupt_block |
198 | * | 198 | * |
199 | * PARAMETERS: interrupt_number - Interrupt for a GPE block | 199 | * PARAMETERS: interrupt_number - Interrupt for a GPE block |
200 | * gpe_xrupt_block - Where the block is returned | ||
200 | * | 201 | * |
201 | * RETURN: A GPE interrupt block | 202 | * RETURN: Status |
202 | * | 203 | * |
203 | * DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt | 204 | * DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt |
204 | * block per unique interrupt level used for GPEs. Should be | 205 | * 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, | |||
207 | * | 208 | * |
208 | ******************************************************************************/ | 209 | ******************************************************************************/ |
209 | 210 | ||
210 | struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number) | 211 | acpi_status |
212 | acpi_ev_get_gpe_xrupt_block(u32 interrupt_number, | ||
213 | struct acpi_gpe_xrupt_info ** gpe_xrupt_block) | ||
211 | { | 214 | { |
212 | struct acpi_gpe_xrupt_info *next_gpe_xrupt; | 215 | struct acpi_gpe_xrupt_info *next_gpe_xrupt; |
213 | struct acpi_gpe_xrupt_info *gpe_xrupt; | 216 | 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) | |||
221 | next_gpe_xrupt = acpi_gbl_gpe_xrupt_list_head; | 224 | next_gpe_xrupt = acpi_gbl_gpe_xrupt_list_head; |
222 | while (next_gpe_xrupt) { | 225 | while (next_gpe_xrupt) { |
223 | if (next_gpe_xrupt->interrupt_number == interrupt_number) { | 226 | if (next_gpe_xrupt->interrupt_number == interrupt_number) { |
224 | return_PTR(next_gpe_xrupt); | 227 | *gpe_xrupt_block = next_gpe_xrupt; |
228 | return_ACPI_STATUS(AE_OK); | ||
225 | } | 229 | } |
226 | 230 | ||
227 | next_gpe_xrupt = next_gpe_xrupt->next; | 231 | 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) | |||
231 | 235 | ||
232 | gpe_xrupt = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_xrupt_info)); | 236 | gpe_xrupt = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_xrupt_info)); |
233 | if (!gpe_xrupt) { | 237 | if (!gpe_xrupt) { |
234 | return_PTR(NULL); | 238 | return_ACPI_STATUS(AE_NO_MEMORY); |
235 | } | 239 | } |
236 | 240 | ||
237 | gpe_xrupt->interrupt_number = interrupt_number; | 241 | gpe_xrupt->interrupt_number = interrupt_number; |
@@ -250,6 +254,7 @@ struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number) | |||
250 | } else { | 254 | } else { |
251 | acpi_gbl_gpe_xrupt_list_head = gpe_xrupt; | 255 | acpi_gbl_gpe_xrupt_list_head = gpe_xrupt; |
252 | } | 256 | } |
257 | |||
253 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); | 258 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); |
254 | 259 | ||
255 | /* Install new interrupt handler if not SCI_INT */ | 260 | /* 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) | |||
259 | acpi_ev_gpe_xrupt_handler, | 264 | acpi_ev_gpe_xrupt_handler, |
260 | gpe_xrupt); | 265 | gpe_xrupt); |
261 | if (ACPI_FAILURE(status)) { | 266 | if (ACPI_FAILURE(status)) { |
262 | ACPI_ERROR((AE_INFO, | 267 | ACPI_EXCEPTION((AE_INFO, status, |
263 | "Could not install GPE interrupt handler at level 0x%X", | 268 | "Could not install GPE interrupt handler at level 0x%X", |
264 | interrupt_number)); | 269 | interrupt_number)); |
265 | return_PTR(NULL); | 270 | return_ACPI_STATUS(status); |
266 | } | 271 | } |
267 | } | 272 | } |
268 | 273 | ||
269 | return_PTR(gpe_xrupt); | 274 | *gpe_xrupt_block = gpe_xrupt; |
275 | return_ACPI_STATUS(AE_OK); | ||
270 | } | 276 | } |
271 | 277 | ||
272 | /******************************************************************************* | 278 | /******************************************************************************* |