diff options
Diffstat (limited to 'drivers/acpi/hardware/hwregs.c')
-rw-r--r-- | drivers/acpi/hardware/hwregs.c | 59 |
1 files changed, 32 insertions, 27 deletions
diff --git a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c index 536a7aea80c9..e1fe75498415 100644 --- a/drivers/acpi/hardware/hwregs.c +++ b/drivers/acpi/hardware/hwregs.c | |||
@@ -7,7 +7,7 @@ | |||
7 | ******************************************************************************/ | 7 | ******************************************************************************/ |
8 | 8 | ||
9 | /* | 9 | /* |
10 | * Copyright (C) 2000 - 2005, R. Byron Moore | 10 | * Copyright (C) 2000 - 2006, R. Byron Moore |
11 | * All rights reserved. | 11 | * All rights reserved. |
12 | * | 12 | * |
13 | * Redistribution and use in source and binary forms, with or without | 13 | * Redistribution and use in source and binary forms, with or without |
@@ -144,7 +144,8 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b) | |||
144 | 144 | ||
145 | info.parameters = NULL; | 145 | info.parameters = NULL; |
146 | info.return_object = NULL; | 146 | info.return_object = NULL; |
147 | sleep_state_name = (char *)acpi_gbl_sleep_state_names[sleep_state]; | 147 | sleep_state_name = |
148 | ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]); | ||
148 | 149 | ||
149 | status = acpi_ns_evaluate_by_name(sleep_state_name, &info); | 150 | status = acpi_ns_evaluate_by_name(sleep_state_name, &info); |
150 | if (ACPI_FAILURE(status)) { | 151 | if (ACPI_FAILURE(status)) { |
@@ -159,15 +160,16 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b) | |||
159 | /* Must have a return object */ | 160 | /* Must have a return object */ |
160 | 161 | ||
161 | if (!info.return_object) { | 162 | if (!info.return_object) { |
162 | ACPI_REPORT_ERROR(("No Sleep State object returned from [%s]\n", | 163 | ACPI_ERROR((AE_INFO, "No Sleep State object returned from [%s]", |
163 | sleep_state_name)); | 164 | sleep_state_name)); |
164 | status = AE_NOT_EXIST; | 165 | status = AE_NOT_EXIST; |
165 | } | 166 | } |
166 | 167 | ||
167 | /* It must be of type Package */ | 168 | /* It must be of type Package */ |
168 | 169 | ||
169 | else if (ACPI_GET_OBJECT_TYPE(info.return_object) != ACPI_TYPE_PACKAGE) { | 170 | else if (ACPI_GET_OBJECT_TYPE(info.return_object) != ACPI_TYPE_PACKAGE) { |
170 | ACPI_REPORT_ERROR(("Sleep State return object is not a Package\n")); | 171 | ACPI_ERROR((AE_INFO, |
172 | "Sleep State return object is not a Package")); | ||
171 | status = AE_AML_OPERAND_TYPE; | 173 | status = AE_AML_OPERAND_TYPE; |
172 | } | 174 | } |
173 | 175 | ||
@@ -179,7 +181,8 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b) | |||
179 | * one per sleep type (A/B). | 181 | * one per sleep type (A/B). |
180 | */ | 182 | */ |
181 | else if (info.return_object->package.count < 2) { | 183 | else if (info.return_object->package.count < 2) { |
182 | ACPI_REPORT_ERROR(("Sleep State return package does not have at least two elements\n")); | 184 | ACPI_ERROR((AE_INFO, |
185 | "Sleep State return package does not have at least two elements")); | ||
183 | status = AE_AML_NO_OPERAND; | 186 | status = AE_AML_NO_OPERAND; |
184 | } | 187 | } |
185 | 188 | ||
@@ -189,7 +192,12 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b) | |||
189 | != ACPI_TYPE_INTEGER) || | 192 | != ACPI_TYPE_INTEGER) || |
190 | (ACPI_GET_OBJECT_TYPE(info.return_object->package.elements[1]) | 193 | (ACPI_GET_OBJECT_TYPE(info.return_object->package.elements[1]) |
191 | != ACPI_TYPE_INTEGER)) { | 194 | != ACPI_TYPE_INTEGER)) { |
192 | ACPI_REPORT_ERROR(("Sleep State return package elements are not both Integers (%s, %s)\n", acpi_ut_get_object_type_name(info.return_object->package.elements[0]), acpi_ut_get_object_type_name(info.return_object->package.elements[1]))); | 195 | ACPI_ERROR((AE_INFO, |
196 | "Sleep State return package elements are not both Integers (%s, %s)", | ||
197 | acpi_ut_get_object_type_name(info.return_object-> | ||
198 | package.elements[0]), | ||
199 | acpi_ut_get_object_type_name(info.return_object-> | ||
200 | package.elements[1]))); | ||
193 | status = AE_AML_OPERAND_TYPE; | 201 | status = AE_AML_OPERAND_TYPE; |
194 | } else { | 202 | } else { |
195 | /* Valid _Sx_ package size, type, and value */ | 203 | /* Valid _Sx_ package size, type, and value */ |
@@ -201,12 +209,11 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b) | |||
201 | } | 209 | } |
202 | 210 | ||
203 | if (ACPI_FAILURE(status)) { | 211 | if (ACPI_FAILURE(status)) { |
204 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 212 | ACPI_EXCEPTION((AE_INFO, status, |
205 | "%s While evaluating sleep_state [%s], bad Sleep object %p type %s\n", | 213 | "While evaluating sleep_state [%s], bad Sleep object %p type %s", |
206 | acpi_format_exception(status), | 214 | sleep_state_name, info.return_object, |
207 | sleep_state_name, info.return_object, | 215 | acpi_ut_get_object_type_name(info. |
208 | acpi_ut_get_object_type_name(info. | 216 | return_object))); |
209 | return_object))); | ||
210 | } | 217 | } |
211 | 218 | ||
212 | acpi_ut_remove_reference(info.return_object); | 219 | acpi_ut_remove_reference(info.return_object); |
@@ -229,12 +236,11 @@ EXPORT_SYMBOL(acpi_get_sleep_type_data); | |||
229 | 236 | ||
230 | struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id) | 237 | struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id) |
231 | { | 238 | { |
232 | ACPI_FUNCTION_NAME("hw_get_bit_register_info"); | 239 | ACPI_FUNCTION_ENTRY(); |
233 | 240 | ||
234 | if (register_id > ACPI_BITREG_MAX) { | 241 | if (register_id > ACPI_BITREG_MAX) { |
235 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 242 | ACPI_ERROR((AE_INFO, "Invalid bit_register ID: %X", |
236 | "Invalid bit_register ID: %X\n", | 243 | register_id)); |
237 | register_id)); | ||
238 | return (NULL); | 244 | return (NULL); |
239 | } | 245 | } |
240 | 246 | ||
@@ -334,8 +340,8 @@ acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags) | |||
334 | 340 | ||
335 | bit_reg_info = acpi_hw_get_bit_register_info(register_id); | 341 | bit_reg_info = acpi_hw_get_bit_register_info(register_id); |
336 | if (!bit_reg_info) { | 342 | if (!bit_reg_info) { |
337 | ACPI_REPORT_ERROR(("Bad ACPI HW register_id: %X\n", | 343 | ACPI_ERROR((AE_INFO, "Bad ACPI HW register_id: %X", |
338 | register_id)); | 344 | register_id)); |
339 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 345 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
340 | } | 346 | } |
341 | 347 | ||
@@ -569,8 +575,7 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | |||
569 | break; | 575 | break; |
570 | 576 | ||
571 | default: | 577 | default: |
572 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unknown Register ID: %X\n", | 578 | ACPI_ERROR((AE_INFO, "Unknown Register ID: %X", register_id)); |
573 | register_id)); | ||
574 | status = AE_BAD_PARAMETER; | 579 | status = AE_BAD_PARAMETER; |
575 | break; | 580 | break; |
576 | } | 581 | } |
@@ -765,9 +770,9 @@ acpi_hw_low_level_read(u32 width, u32 * value, struct acpi_generic_address *reg) | |||
765 | break; | 770 | break; |
766 | 771 | ||
767 | default: | 772 | default: |
768 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 773 | ACPI_ERROR((AE_INFO, |
769 | "Unsupported address space: %X\n", | 774 | "Unsupported address space: %X", |
770 | reg->address_space_id)); | 775 | reg->address_space_id)); |
771 | return (AE_BAD_PARAMETER); | 776 | return (AE_BAD_PARAMETER); |
772 | } | 777 | } |
773 | 778 | ||
@@ -836,9 +841,9 @@ acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address * reg) | |||
836 | break; | 841 | break; |
837 | 842 | ||
838 | default: | 843 | default: |
839 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 844 | ACPI_ERROR((AE_INFO, |
840 | "Unsupported address space: %X\n", | 845 | "Unsupported address space: %X", |
841 | reg->address_space_id)); | 846 | reg->address_space_id)); |
842 | return (AE_BAD_PARAMETER); | 847 | return (AE_BAD_PARAMETER); |
843 | } | 848 | } |
844 | 849 | ||