diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-06 22:35:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-06 22:35:13 -0400 |
commit | 59df1c2bdecb0d1aaadfb8533df4bea528ee4952 (patch) | |
tree | ded1e05c84622331dd6a61b24db31e9b920f6970 /drivers | |
parent | c620f7bd0ba5c882b3e7fc199a8d5c2f6c2f5263 (diff) | |
parent | 10b4768b27a0b8f9459570723ecb1809f4d707e0 (diff) |
Merge tag 'acpi-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI updates from Rafael Wysocki:
"These rearrange the ACPI documentation by converting it to the .rst
format and splitting it into clear categories (admin guide, driver
API, firmware guide), switch over multiple users of a problematic
library function to a new better one, update the ACPICA code in the
kernel to a new upstream release, fix a few issues, improve power
device management diagnostics and do some cleanups.
Specifics:
- Convert the ACPI documentation in the kernel source tree to the
.rst format and split it into the admin guide, driver API and
firmware guide parts (Changbin Du).
- Add a PRP0001 usage example to the ACPI documentation (Thomas
Preston).
- Switch over the users of the acpi_dev_get_first_match_name()
library function which turned out to be problematic to a new,
better one called acpi_dev_get_first_match_dev() (Andy Shevchenko,
YueHaibing).
- Update the ACPICA code in the kernel to upstream release 20190405
including:
* Null pointer dereference check in acpi_ns_delete_node() (Erik
Schmauss).
* Multiple macro and function name changes (Bob Moore).
* Predefined operation region name fix (Erik Schmauss).
- Fix hibernation issue on systems using the Baytrail and Cherrytrail
Intel SoCs introduced during the 4.20 development cycle (Hans de
Goede).
- Add Sony VPCEH3U1E to the backlight quirk list (Zhang Rui).
- Fix button handling during system resume (Zhang Rui).
- Add a device PM diagnostic message (Rafael Wysocki).
- Clean up the code, comments and white space in multiple places
(Bjorn Helgaas, Gustavo Silva, Kefeng Wang)"
* tag 'acpi-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (53 commits)
Documentation: ACPI: move video_extension.txt to firmware-guide/acpi and convert to reST
Documentation: ACPI: move ssdt-overlays.txt to admin-guide/acpi and convert to reST
Documentation: ACPI: move lpit.txt to firmware-guide/acpi and convert to reST
Documentation: ACPI: move cppc_sysfs.txt to admin-guide/acpi and convert to reST
Documentation: ACPI: move apei/einj.txt to firmware-guide/acpi and convert to reST
Documentation: ACPI: move apei/output_format.txt to firmware-guide/acpi and convert to reST
Documentation: ACPI: move aml-debugger.txt to firmware-guide/acpi and convert to reST
Documentation: ACPI: move method-tracing.txt to firmware-guide/acpi and convert to rsST
Documentation: ACPI: move debug.txt to firmware-guide/acpi and convert to reST
Documentation: ACPI: move dsd/data-node-references.txt to firmware-guide/acpi and convert to reST
Documentation: ACPI: move dsd/graph.txt to firmware-guide/acpi and convert to reST
Documentation: ACPI: move acpi-lid.txt to firmware-guide/acpi and convert to reST
Documentation: ACPI: move i2c-muxes.txt to firmware-guide/acpi and convert to reST
Documentation: ACPI: move dsdt-override.txt to admin-guide/acpi and convert to reST
Documentation: ACPI: move initrd_table_override.txt to admin-guide/acpi and convert to reST
Documentation: ACPI: move method-customizing.txt to firmware-guide/acpi and convert to reST
Documentation: ACPI: move gpio-properties.txt to firmware-guide/acpi and convert to reST
Documentation: ACPI: move DSD-properties-rules.txt to firmware-guide/acpi and covert to reST
Documentation: ACPI: move scan_handlers.txt to driver-api/acpi and convert to reST
Documentation: ACPI: move linuxized-acpica.txt to driver-api/acpi and convert to reST
...
Diffstat (limited to 'drivers')
51 files changed, 209 insertions, 186 deletions
diff --git a/drivers/acpi/acpi_configfs.c b/drivers/acpi/acpi_configfs.c index 81bfc6197293..f92033661239 100644 --- a/drivers/acpi/acpi_configfs.c +++ b/drivers/acpi/acpi_configfs.c | |||
@@ -109,7 +109,7 @@ static ssize_t acpi_table_signature_show(struct config_item *cfg, char *str) | |||
109 | if (!h) | 109 | if (!h) |
110 | return -EINVAL; | 110 | return -EINVAL; |
111 | 111 | ||
112 | return sprintf(str, "%.*s\n", ACPI_NAME_SIZE, h->signature); | 112 | return sprintf(str, "%.*s\n", ACPI_NAMESEG_SIZE, h->signature); |
113 | } | 113 | } |
114 | 114 | ||
115 | static ssize_t acpi_table_length_show(struct config_item *cfg, char *str) | 115 | static ssize_t acpi_table_length_show(struct config_item *cfg, char *str) |
@@ -170,7 +170,7 @@ static ssize_t acpi_table_asl_compiler_id_show(struct config_item *cfg, | |||
170 | if (!h) | 170 | if (!h) |
171 | return -EINVAL; | 171 | return -EINVAL; |
172 | 172 | ||
173 | return sprintf(str, "%.*s\n", ACPI_NAME_SIZE, h->asl_compiler_id); | 173 | return sprintf(str, "%.*s\n", ACPI_NAMESEG_SIZE, h->asl_compiler_id); |
174 | } | 174 | } |
175 | 175 | ||
176 | static ssize_t acpi_table_asl_compiler_revision_show(struct config_item *cfg, | 176 | static ssize_t acpi_table_asl_compiler_revision_show(struct config_item *cfg, |
diff --git a/drivers/acpi/acpi_dbg.c b/drivers/acpi/acpi_dbg.c index 4a434c23a196..d18246a2a65e 100644 --- a/drivers/acpi/acpi_dbg.c +++ b/drivers/acpi/acpi_dbg.c | |||
@@ -390,7 +390,7 @@ again: | |||
390 | return size > 0 ? size : ret; | 390 | return size > 0 ? size : ret; |
391 | } | 391 | } |
392 | 392 | ||
393 | static int acpi_aml_thread(void *unsed) | 393 | static int acpi_aml_thread(void *unused) |
394 | { | 394 | { |
395 | acpi_osd_exec_callback function = NULL; | 395 | acpi_osd_exec_callback function = NULL; |
396 | void *context; | 396 | void *context; |
diff --git a/drivers/acpi/acpi_lpat.c b/drivers/acpi/acpi_lpat.c index 2cd9f738812b..43f1b99c86ca 100644 --- a/drivers/acpi/acpi_lpat.c +++ b/drivers/acpi/acpi_lpat.c | |||
@@ -22,7 +22,7 @@ | |||
22 | * LPAT conversion table | 22 | * LPAT conversion table |
23 | * | 23 | * |
24 | * @lpat_table: the temperature_raw mapping table structure | 24 | * @lpat_table: the temperature_raw mapping table structure |
25 | * @raw: the raw value, used as a key to get the temerature from the | 25 | * @raw: the raw value, used as a key to get the temperature from the |
26 | * above mapping table | 26 | * above mapping table |
27 | * | 27 | * |
28 | * A positive converted temperature value will be returned on success, | 28 | * A positive converted temperature value will be returned on success, |
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index 1e2a10a06b9d..cf768608437e 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c | |||
@@ -1142,8 +1142,8 @@ static struct dev_pm_domain acpi_lpss_pm_domain = { | |||
1142 | .thaw_noirq = acpi_subsys_thaw_noirq, | 1142 | .thaw_noirq = acpi_subsys_thaw_noirq, |
1143 | .poweroff = acpi_subsys_suspend, | 1143 | .poweroff = acpi_subsys_suspend, |
1144 | .poweroff_late = acpi_lpss_suspend_late, | 1144 | .poweroff_late = acpi_lpss_suspend_late, |
1145 | .poweroff_noirq = acpi_subsys_suspend_noirq, | 1145 | .poweroff_noirq = acpi_lpss_suspend_noirq, |
1146 | .restore_noirq = acpi_subsys_resume_noirq, | 1146 | .restore_noirq = acpi_lpss_resume_noirq, |
1147 | .restore_early = acpi_lpss_resume_early, | 1147 | .restore_early = acpi_lpss_resume_early, |
1148 | #endif | 1148 | #endif |
1149 | .runtime_suspend = acpi_lpss_runtime_suspend, | 1149 | .runtime_suspend = acpi_lpss_runtime_suspend, |
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h index a2dfbf6b004e..13d513b81589 100644 --- a/drivers/acpi/acpica/aclocal.h +++ b/drivers/acpi/acpica/aclocal.h | |||
@@ -293,7 +293,7 @@ acpi_status (*acpi_internal_method) (struct acpi_walk_state * walk_state); | |||
293 | * expected_return_btypes - Allowed type(s) for the return value | 293 | * expected_return_btypes - Allowed type(s) for the return value |
294 | */ | 294 | */ |
295 | struct acpi_name_info { | 295 | struct acpi_name_info { |
296 | char name[ACPI_NAME_SIZE]; | 296 | char name[ACPI_NAMESEG_SIZE]; |
297 | u16 argument_list; | 297 | u16 argument_list; |
298 | u8 expected_btypes; | 298 | u8 expected_btypes; |
299 | }; | 299 | }; |
@@ -370,7 +370,7 @@ typedef acpi_status (*acpi_object_converter) (struct acpi_namespace_node * | |||
370 | converted_object); | 370 | converted_object); |
371 | 371 | ||
372 | struct acpi_simple_repair_info { | 372 | struct acpi_simple_repair_info { |
373 | char name[ACPI_NAME_SIZE]; | 373 | char name[ACPI_NAMESEG_SIZE]; |
374 | u32 unexpected_btypes; | 374 | u32 unexpected_btypes; |
375 | u32 package_index; | 375 | u32 package_index; |
376 | acpi_object_converter object_converter; | 376 | acpi_object_converter object_converter; |
diff --git a/drivers/acpi/acpica/dbexec.c b/drivers/acpi/acpica/dbexec.c index bb43305cb215..4027eaab18a4 100644 --- a/drivers/acpi/acpica/dbexec.c +++ b/drivers/acpi/acpica/dbexec.c | |||
@@ -453,7 +453,7 @@ acpi_db_execute(char *name, char **args, acpi_object_type *types, u32 flags) | |||
453 | 453 | ||
454 | /* Dump a _PLD buffer if present */ | 454 | /* Dump a _PLD buffer if present */ |
455 | 455 | ||
456 | if (ACPI_COMPARE_NAME | 456 | if (ACPI_COMPARE_NAMESEG |
457 | ((ACPI_CAST_PTR | 457 | ((ACPI_CAST_PTR |
458 | (struct acpi_namespace_node, | 458 | (struct acpi_namespace_node, |
459 | acpi_gbl_db_method_info.method)->name.ascii), | 459 | acpi_gbl_db_method_info.method)->name.ascii), |
diff --git a/drivers/acpi/acpica/dbnames.c b/drivers/acpi/acpica/dbnames.c index 004d34d9369b..63fe30e86807 100644 --- a/drivers/acpi/acpica/dbnames.c +++ b/drivers/acpi/acpica/dbnames.c | |||
@@ -354,7 +354,7 @@ acpi_status acpi_db_find_name_in_namespace(char *name_arg) | |||
354 | char acpi_name[5] = "____"; | 354 | char acpi_name[5] = "____"; |
355 | char *acpi_name_ptr = acpi_name; | 355 | char *acpi_name_ptr = acpi_name; |
356 | 356 | ||
357 | if (strlen(name_arg) > ACPI_NAME_SIZE) { | 357 | if (strlen(name_arg) > ACPI_NAMESEG_SIZE) { |
358 | acpi_os_printf("Name must be no longer than 4 characters\n"); | 358 | acpi_os_printf("Name must be no longer than 4 characters\n"); |
359 | return (AE_OK); | 359 | return (AE_OK); |
360 | } | 360 | } |
diff --git a/drivers/acpi/acpica/dsinit.c b/drivers/acpi/acpica/dsinit.c index a4a24ffe5fae..4ebd23700bbc 100644 --- a/drivers/acpi/acpica/dsinit.c +++ b/drivers/acpi/acpica/dsinit.c | |||
@@ -200,7 +200,7 @@ acpi_ds_initialize_objects(u32 table_index, | |||
200 | 200 | ||
201 | /* DSDT is always the first AML table */ | 201 | /* DSDT is always the first AML table */ |
202 | 202 | ||
203 | if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_DSDT)) { | 203 | if (ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_DSDT)) { |
204 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, | 204 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, |
205 | "\nInitializing Namespace objects:\n")); | 205 | "\nInitializing Namespace objects:\n")); |
206 | } | 206 | } |
diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c index c92d2f6ebe01..b04f982e59fa 100644 --- a/drivers/acpi/acpica/evgpeinit.c +++ b/drivers/acpi/acpica/evgpeinit.c | |||
@@ -292,7 +292,7 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle, | |||
292 | acpi_status status; | 292 | acpi_status status; |
293 | u32 gpe_number; | 293 | u32 gpe_number; |
294 | u8 temp_gpe_number; | 294 | u8 temp_gpe_number; |
295 | char name[ACPI_NAME_SIZE + 1]; | 295 | char name[ACPI_NAMESEG_SIZE + 1]; |
296 | u8 type; | 296 | u8 type; |
297 | 297 | ||
298 | ACPI_FUNCTION_TRACE(ev_match_gpe_method); | 298 | ACPI_FUNCTION_TRACE(ev_match_gpe_method); |
@@ -310,7 +310,7 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle, | |||
310 | * 1) Extract the method name and null terminate it | 310 | * 1) Extract the method name and null terminate it |
311 | */ | 311 | */ |
312 | ACPI_MOVE_32_TO_32(name, &method_node->name.integer); | 312 | ACPI_MOVE_32_TO_32(name, &method_node->name.integer); |
313 | name[ACPI_NAME_SIZE] = 0; | 313 | name[ACPI_NAMESEG_SIZE] = 0; |
314 | 314 | ||
315 | /* 2) Name must begin with an underscore */ | 315 | /* 2) Name must begin with an underscore */ |
316 | 316 | ||
diff --git a/drivers/acpi/acpica/exnames.c b/drivers/acpi/acpica/exnames.c index bd68d66e89f0..6b76be5212a4 100644 --- a/drivers/acpi/acpica/exnames.c +++ b/drivers/acpi/acpica/exnames.c | |||
@@ -53,10 +53,10 @@ static char *acpi_ex_allocate_name_string(u32 prefix_count, u32 num_name_segs) | |||
53 | 53 | ||
54 | /* Special case for root */ | 54 | /* Special case for root */ |
55 | 55 | ||
56 | size_needed = 1 + (ACPI_NAME_SIZE * num_name_segs) + 2 + 1; | 56 | size_needed = 1 + (ACPI_NAMESEG_SIZE * num_name_segs) + 2 + 1; |
57 | } else { | 57 | } else { |
58 | size_needed = | 58 | size_needed = |
59 | prefix_count + (ACPI_NAME_SIZE * num_name_segs) + 2 + 1; | 59 | prefix_count + (ACPI_NAMESEG_SIZE * num_name_segs) + 2 + 1; |
60 | } | 60 | } |
61 | 61 | ||
62 | /* | 62 | /* |
@@ -141,7 +141,7 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string) | |||
141 | } | 141 | } |
142 | 142 | ||
143 | for (index = 0; | 143 | for (index = 0; |
144 | (index < ACPI_NAME_SIZE) | 144 | (index < ACPI_NAMESEG_SIZE) |
145 | && (acpi_ut_valid_name_char(*aml_address, 0)); index++) { | 145 | && (acpi_ut_valid_name_char(*aml_address, 0)); index++) { |
146 | char_buf[index] = *aml_address++; | 146 | char_buf[index] = *aml_address++; |
147 | } | 147 | } |
diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c index 75192b958544..7b855603f81a 100644 --- a/drivers/acpi/acpica/nsaccess.c +++ b/drivers/acpi/acpica/nsaccess.c | |||
@@ -683,7 +683,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, | |||
683 | 683 | ||
684 | /* Point to next name segment and make this node current */ | 684 | /* Point to next name segment and make this node current */ |
685 | 685 | ||
686 | path += ACPI_NAME_SIZE; | 686 | path += ACPI_NAMESEG_SIZE; |
687 | current_node = this_node; | 687 | current_node = this_node; |
688 | } | 688 | } |
689 | 689 | ||
diff --git a/drivers/acpi/acpica/nsalloc.c b/drivers/acpi/acpica/nsalloc.c index 5470213b8e64..6eb63db72249 100644 --- a/drivers/acpi/acpica/nsalloc.c +++ b/drivers/acpi/acpica/nsalloc.c | |||
@@ -74,6 +74,10 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node) | |||
74 | 74 | ||
75 | ACPI_FUNCTION_NAME(ns_delete_node); | 75 | ACPI_FUNCTION_NAME(ns_delete_node); |
76 | 76 | ||
77 | if (!node) { | ||
78 | return_VOID; | ||
79 | } | ||
80 | |||
77 | /* Detach an object if there is one */ | 81 | /* Detach an object if there is one */ |
78 | 82 | ||
79 | acpi_ns_detach_object(node); | 83 | acpi_ns_detach_object(node); |
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c index 15070bd0c28a..1b12c172e115 100644 --- a/drivers/acpi/acpica/nsdump.c +++ b/drivers/acpi/acpica/nsdump.c | |||
@@ -70,7 +70,7 @@ void acpi_ns_print_pathname(u32 num_segments, const char *pathname) | |||
70 | acpi_os_printf("?"); | 70 | acpi_os_printf("?"); |
71 | } | 71 | } |
72 | 72 | ||
73 | pathname += ACPI_NAME_SIZE; | 73 | pathname += ACPI_NAMESEG_SIZE; |
74 | num_segments--; | 74 | num_segments--; |
75 | if (num_segments) { | 75 | if (num_segments) { |
76 | acpi_os_printf("."); | 76 | acpi_os_printf("."); |
diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c index 19fb8dda870f..53e5d00d3a5e 100644 --- a/drivers/acpi/acpica/nsinit.c +++ b/drivers/acpi/acpica/nsinit.c | |||
@@ -478,7 +478,7 @@ acpi_ns_find_ini_methods(acpi_handle obj_handle, | |||
478 | 478 | ||
479 | /* We are only looking for methods named _INI */ | 479 | /* We are only looking for methods named _INI */ |
480 | 480 | ||
481 | if (!ACPI_COMPARE_NAME(node->name.ascii, METHOD_NAME__INI)) { | 481 | if (!ACPI_COMPARE_NAMESEG(node->name.ascii, METHOD_NAME__INI)) { |
482 | return (AE_OK); | 482 | return (AE_OK); |
483 | } | 483 | } |
484 | 484 | ||
@@ -641,7 +641,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle, | |||
641 | * Note: We know there is an _INI within this subtree, but it may not be | 641 | * Note: We know there is an _INI within this subtree, but it may not be |
642 | * under this particular device, it may be lower in the branch. | 642 | * under this particular device, it may be lower in the branch. |
643 | */ | 643 | */ |
644 | if (!ACPI_COMPARE_NAME(device_node->name.ascii, "_SB_") || | 644 | if (!ACPI_COMPARE_NAMESEG(device_node->name.ascii, "_SB_") || |
645 | device_node->parent != acpi_gbl_root_node) { | 645 | device_node->parent != acpi_gbl_root_node) { |
646 | ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname | 646 | ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname |
647 | (ACPI_TYPE_METHOD, device_node, | 647 | (ACPI_TYPE_METHOD, device_node, |
diff --git a/drivers/acpi/acpica/nsnames.c b/drivers/acpi/acpica/nsnames.c index 289c15bb8c6a..370bbc867745 100644 --- a/drivers/acpi/acpica/nsnames.c +++ b/drivers/acpi/acpica/nsnames.c | |||
@@ -108,8 +108,8 @@ acpi_ns_handle_to_name(acpi_handle target_handle, struct acpi_buffer *buffer) | |||
108 | /* Just copy the ACPI name from the Node and zero terminate it */ | 108 | /* Just copy the ACPI name from the Node and zero terminate it */ |
109 | 109 | ||
110 | node_name = acpi_ut_get_node_name(node); | 110 | node_name = acpi_ut_get_node_name(node); |
111 | ACPI_MOVE_NAME(buffer->pointer, node_name); | 111 | ACPI_COPY_NAMESEG(buffer->pointer, node_name); |
112 | ((char *)buffer->pointer)[ACPI_NAME_SIZE] = 0; | 112 | ((char *)buffer->pointer)[ACPI_NAMESEG_SIZE] = 0; |
113 | 113 | ||
114 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%4.4s\n", (char *)buffer->pointer)); | 114 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%4.4s\n", (char *)buffer->pointer)); |
115 | return_ACPI_STATUS(AE_OK); | 115 | return_ACPI_STATUS(AE_OK); |
@@ -198,7 +198,7 @@ acpi_ns_build_normalized_path(struct acpi_namespace_node *node, | |||
198 | char *full_path, u32 path_size, u8 no_trailing) | 198 | char *full_path, u32 path_size, u8 no_trailing) |
199 | { | 199 | { |
200 | u32 length = 0, i; | 200 | u32 length = 0, i; |
201 | char name[ACPI_NAME_SIZE]; | 201 | char name[ACPI_NAMESEG_SIZE]; |
202 | u8 do_no_trailing; | 202 | u8 do_no_trailing; |
203 | char c, *left, *right; | 203 | char c, *left, *right; |
204 | struct acpi_namespace_node *next_node; | 204 | struct acpi_namespace_node *next_node; |
@@ -446,7 +446,7 @@ static void acpi_ns_normalize_pathname(char *original_path) | |||
446 | 446 | ||
447 | /* Do one nameseg at a time */ | 447 | /* Do one nameseg at a time */ |
448 | 448 | ||
449 | for (i = 0; (i < ACPI_NAME_SIZE) && *input_path; i++) { | 449 | for (i = 0; (i < ACPI_NAMESEG_SIZE) && *input_path; i++) { |
450 | if ((i == 0) || (*input_path != '_')) { /* First char is allowed to be underscore */ | 450 | if ((i == 0) || (*input_path != '_')) { /* First char is allowed to be underscore */ |
451 | *new_path = *input_path; | 451 | *new_path = *input_path; |
452 | new_path++; | 452 | new_path++; |
diff --git a/drivers/acpi/acpica/nsparse.c b/drivers/acpi/acpica/nsparse.c index c0b4f7bedfab..f16cf5e4742c 100644 --- a/drivers/acpi/acpica/nsparse.c +++ b/drivers/acpi/acpica/nsparse.c | |||
@@ -203,7 +203,7 @@ acpi_ns_one_complete_parse(u32 pass_number, | |||
203 | 203 | ||
204 | /* Found OSDT table, enable the namespace override feature */ | 204 | /* Found OSDT table, enable the namespace override feature */ |
205 | 205 | ||
206 | if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_OSDT) && | 206 | if (ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_OSDT) && |
207 | pass_number == ACPI_IMODE_LOAD_PASS1) { | 207 | pass_number == ACPI_IMODE_LOAD_PASS1) { |
208 | walk_state->namespace_override = TRUE; | 208 | walk_state->namespace_override = TRUE; |
209 | } | 209 | } |
diff --git a/drivers/acpi/acpica/nsrepair.c b/drivers/acpi/acpica/nsrepair.c index 0aacfa48e20d..be86fea8e4d4 100644 --- a/drivers/acpi/acpica/nsrepair.c +++ b/drivers/acpi/acpica/nsrepair.c | |||
@@ -316,7 +316,7 @@ static const struct acpi_simple_repair_info *acpi_ns_match_simple_repair(struct | |||
316 | 316 | ||
317 | this_name = acpi_object_repair_info; | 317 | this_name = acpi_object_repair_info; |
318 | while (this_name->object_converter) { | 318 | while (this_name->object_converter) { |
319 | if (ACPI_COMPARE_NAME(node->name.ascii, this_name->name)) { | 319 | if (ACPI_COMPARE_NAMESEG(node->name.ascii, this_name->name)) { |
320 | 320 | ||
321 | /* Check if we can actually repair this name/type combination */ | 321 | /* Check if we can actually repair this name/type combination */ |
322 | 322 | ||
diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c index d5804a6d1d65..8d776256b213 100644 --- a/drivers/acpi/acpica/nsrepair2.c +++ b/drivers/acpi/acpica/nsrepair2.c | |||
@@ -25,7 +25,7 @@ acpi_status (*acpi_repair_function) (struct acpi_evaluate_info * info, | |||
25 | return_object_ptr); | 25 | return_object_ptr); |
26 | 26 | ||
27 | typedef struct acpi_repair_info { | 27 | typedef struct acpi_repair_info { |
28 | char name[ACPI_NAME_SIZE]; | 28 | char name[ACPI_NAMESEG_SIZE]; |
29 | acpi_repair_function repair_function; | 29 | acpi_repair_function repair_function; |
30 | 30 | ||
31 | } acpi_repair_info; | 31 | } acpi_repair_info; |
@@ -188,7 +188,7 @@ static const struct acpi_repair_info *acpi_ns_match_complex_repair(struct | |||
188 | 188 | ||
189 | this_name = acpi_ns_repairable_names; | 189 | this_name = acpi_ns_repairable_names; |
190 | while (this_name->repair_function) { | 190 | while (this_name->repair_function) { |
191 | if (ACPI_COMPARE_NAME(node->name.ascii, this_name->name)) { | 191 | if (ACPI_COMPARE_NAMESEG(node->name.ascii, this_name->name)) { |
192 | return (this_name); | 192 | return (this_name); |
193 | } | 193 | } |
194 | 194 | ||
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c index e5cef1edf49f..6bc90d46db5c 100644 --- a/drivers/acpi/acpica/nsutils.c +++ b/drivers/acpi/acpica/nsutils.c | |||
@@ -178,7 +178,7 @@ void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info) | |||
178 | } | 178 | } |
179 | } | 179 | } |
180 | 180 | ||
181 | info->length = (ACPI_NAME_SIZE * info->num_segments) + | 181 | info->length = (ACPI_NAMESEG_SIZE * info->num_segments) + |
182 | 4 + info->num_carats; | 182 | 4 + info->num_carats; |
183 | 183 | ||
184 | info->next_external_char = next_external_char; | 184 | info->next_external_char = next_external_char; |
@@ -249,7 +249,7 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info) | |||
249 | /* Build the name (minus path separators) */ | 249 | /* Build the name (minus path separators) */ |
250 | 250 | ||
251 | for (; num_segments; num_segments--) { | 251 | for (; num_segments; num_segments--) { |
252 | for (i = 0; i < ACPI_NAME_SIZE; i++) { | 252 | for (i = 0; i < ACPI_NAMESEG_SIZE; i++) { |
253 | if (ACPI_IS_PATH_SEPARATOR(*external_name) || | 253 | if (ACPI_IS_PATH_SEPARATOR(*external_name) || |
254 | (*external_name == 0)) { | 254 | (*external_name == 0)) { |
255 | 255 | ||
@@ -274,7 +274,7 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info) | |||
274 | /* Move on the next segment */ | 274 | /* Move on the next segment */ |
275 | 275 | ||
276 | external_name++; | 276 | external_name++; |
277 | result += ACPI_NAME_SIZE; | 277 | result += ACPI_NAMESEG_SIZE; |
278 | } | 278 | } |
279 | 279 | ||
280 | /* Terminate the string */ | 280 | /* Terminate the string */ |
@@ -489,12 +489,12 @@ acpi_ns_externalize_name(u32 internal_name_length, | |||
489 | 489 | ||
490 | /* Copy and validate the 4-char name segment */ | 490 | /* Copy and validate the 4-char name segment */ |
491 | 491 | ||
492 | ACPI_MOVE_NAME(&(*converted_name)[j], | 492 | ACPI_COPY_NAMESEG(&(*converted_name)[j], |
493 | &internal_name[names_index]); | 493 | &internal_name[names_index]); |
494 | acpi_ut_repair_name(&(*converted_name)[j]); | 494 | acpi_ut_repair_name(&(*converted_name)[j]); |
495 | 495 | ||
496 | j += ACPI_NAME_SIZE; | 496 | j += ACPI_NAMESEG_SIZE; |
497 | names_index += ACPI_NAME_SIZE; | 497 | names_index += ACPI_NAMESEG_SIZE; |
498 | } | 498 | } |
499 | } | 499 | } |
500 | 500 | ||
diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c index de2d3135d6a9..55b4a5b3331f 100644 --- a/drivers/acpi/acpica/nsxfname.c +++ b/drivers/acpi/acpica/nsxfname.c | |||
@@ -495,8 +495,8 @@ acpi_status acpi_install_method(u8 *buffer) | |||
495 | 495 | ||
496 | /* Table must be a DSDT or SSDT */ | 496 | /* Table must be a DSDT or SSDT */ |
497 | 497 | ||
498 | if (!ACPI_COMPARE_NAME(table->signature, ACPI_SIG_DSDT) && | 498 | if (!ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_DSDT) && |
499 | !ACPI_COMPARE_NAME(table->signature, ACPI_SIG_SSDT)) { | 499 | !ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_SSDT)) { |
500 | return (AE_BAD_HEADER); | 500 | return (AE_BAD_HEADER); |
501 | } | 501 | } |
502 | 502 | ||
diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c index 9d9d442cd999..e62c7897fdf1 100644 --- a/drivers/acpi/acpica/psargs.c +++ b/drivers/acpi/acpica/psargs.c | |||
@@ -150,21 +150,21 @@ char *acpi_ps_get_next_namestring(struct acpi_parse_state *parser_state) | |||
150 | 150 | ||
151 | /* Two name segments */ | 151 | /* Two name segments */ |
152 | 152 | ||
153 | end += 1 + (2 * ACPI_NAME_SIZE); | 153 | end += 1 + (2 * ACPI_NAMESEG_SIZE); |
154 | break; | 154 | break; |
155 | 155 | ||
156 | case AML_MULTI_NAME_PREFIX: | 156 | case AML_MULTI_NAME_PREFIX: |
157 | 157 | ||
158 | /* Multiple name segments, 4 chars each, count in next byte */ | 158 | /* Multiple name segments, 4 chars each, count in next byte */ |
159 | 159 | ||
160 | end += 2 + (*(end + 1) * ACPI_NAME_SIZE); | 160 | end += 2 + (*(end + 1) * ACPI_NAMESEG_SIZE); |
161 | break; | 161 | break; |
162 | 162 | ||
163 | default: | 163 | default: |
164 | 164 | ||
165 | /* Single name segment */ | 165 | /* Single name segment */ |
166 | 166 | ||
167 | end += ACPI_NAME_SIZE; | 167 | end += ACPI_NAMESEG_SIZE; |
168 | break; | 168 | break; |
169 | } | 169 | } |
170 | 170 | ||
@@ -522,7 +522,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state | |||
522 | 522 | ||
523 | ACPI_MOVE_32_TO_32(&name, parser_state->aml); | 523 | ACPI_MOVE_32_TO_32(&name, parser_state->aml); |
524 | acpi_ps_set_name(field, name); | 524 | acpi_ps_set_name(field, name); |
525 | parser_state->aml += ACPI_NAME_SIZE; | 525 | parser_state->aml += ACPI_NAMESEG_SIZE; |
526 | 526 | ||
527 | ASL_CV_CAPTURE_COMMENTS_ONLY(parser_state); | 527 | ASL_CV_CAPTURE_COMMENTS_ONLY(parser_state); |
528 | 528 | ||
diff --git a/drivers/acpi/acpica/rsxface.c b/drivers/acpi/acpica/rsxface.c index 1d6f136e4068..c62be3d91712 100644 --- a/drivers/acpi/acpica/rsxface.c +++ b/drivers/acpi/acpica/rsxface.c | |||
@@ -603,10 +603,10 @@ acpi_walk_resources(acpi_handle device_handle, | |||
603 | /* Parameter validation */ | 603 | /* Parameter validation */ |
604 | 604 | ||
605 | if (!device_handle || !user_function || !name || | 605 | if (!device_handle || !user_function || !name || |
606 | (!ACPI_COMPARE_NAME(name, METHOD_NAME__CRS) && | 606 | (!ACPI_COMPARE_NAMESEG(name, METHOD_NAME__CRS) && |
607 | !ACPI_COMPARE_NAME(name, METHOD_NAME__PRS) && | 607 | !ACPI_COMPARE_NAMESEG(name, METHOD_NAME__PRS) && |
608 | !ACPI_COMPARE_NAME(name, METHOD_NAME__AEI) && | 608 | !ACPI_COMPARE_NAMESEG(name, METHOD_NAME__AEI) && |
609 | !ACPI_COMPARE_NAME(name, METHOD_NAME__DMA))) { | 609 | !ACPI_COMPARE_NAMESEG(name, METHOD_NAME__DMA))) { |
610 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 610 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
611 | } | 611 | } |
612 | 612 | ||
diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c index 0cecd0039acf..933f81316ad2 100644 --- a/drivers/acpi/acpica/tbdata.c +++ b/drivers/acpi/acpica/tbdata.c | |||
@@ -480,7 +480,8 @@ acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc, | |||
480 | 480 | ||
481 | /* If a particular signature is expected (DSDT/FACS), it must match */ | 481 | /* If a particular signature is expected (DSDT/FACS), it must match */ |
482 | 482 | ||
483 | if (signature && !ACPI_COMPARE_NAME(&table_desc->signature, signature)) { | 483 | if (signature && |
484 | !ACPI_COMPARE_NAMESEG(&table_desc->signature, signature)) { | ||
484 | ACPI_BIOS_ERROR((AE_INFO, | 485 | ACPI_BIOS_ERROR((AE_INFO, |
485 | "Invalid signature 0x%X for ACPI table, expected [%s]", | 486 | "Invalid signature 0x%X for ACPI table, expected [%s]", |
486 | table_desc->signature.integer, signature)); | 487 | table_desc->signature.integer, signature)); |
diff --git a/drivers/acpi/acpica/tbfind.c b/drivers/acpi/acpica/tbfind.c index 951bd8e1c50a..b2abb40023a6 100644 --- a/drivers/acpi/acpica/tbfind.c +++ b/drivers/acpi/acpica/tbfind.c | |||
@@ -56,7 +56,7 @@ acpi_tb_find_table(char *signature, | |||
56 | /* Normalize the input strings */ | 56 | /* Normalize the input strings */ |
57 | 57 | ||
58 | memset(&header, 0, sizeof(struct acpi_table_header)); | 58 | memset(&header, 0, sizeof(struct acpi_table_header)); |
59 | ACPI_MOVE_NAME(header.signature, signature); | 59 | ACPI_COPY_NAMESEG(header.signature, signature); |
60 | strncpy(header.oem_id, oem_id, ACPI_OEM_ID_SIZE); | 60 | strncpy(header.oem_id, oem_id, ACPI_OEM_ID_SIZE); |
61 | strncpy(header.oem_table_id, oem_table_id, ACPI_OEM_TABLE_ID_SIZE); | 61 | strncpy(header.oem_table_id, oem_table_id, ACPI_OEM_TABLE_ID_SIZE); |
62 | 62 | ||
@@ -65,7 +65,7 @@ acpi_tb_find_table(char *signature, | |||
65 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 65 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); |
66 | for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) { | 66 | for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) { |
67 | if (memcmp(&(acpi_gbl_root_table_list.tables[i].signature), | 67 | if (memcmp(&(acpi_gbl_root_table_list.tables[i].signature), |
68 | header.signature, ACPI_NAME_SIZE)) { | 68 | header.signature, ACPI_NAMESEG_SIZE)) { |
69 | 69 | ||
70 | /* Not the requested table */ | 70 | /* Not the requested table */ |
71 | 71 | ||
@@ -94,14 +94,14 @@ acpi_tb_find_table(char *signature, | |||
94 | 94 | ||
95 | if (!memcmp | 95 | if (!memcmp |
96 | (acpi_gbl_root_table_list.tables[i].pointer->signature, | 96 | (acpi_gbl_root_table_list.tables[i].pointer->signature, |
97 | header.signature, ACPI_NAME_SIZE) && (!oem_id[0] | 97 | header.signature, ACPI_NAMESEG_SIZE) && (!oem_id[0] |
98 | || | 98 | || |
99 | !memcmp | 99 | !memcmp |
100 | (acpi_gbl_root_table_list. | 100 | (acpi_gbl_root_table_list. |
101 | tables[i].pointer-> | 101 | tables[i]. |
102 | oem_id, | 102 | pointer->oem_id, |
103 | header.oem_id, | 103 | header.oem_id, |
104 | ACPI_OEM_ID_SIZE)) | 104 | ACPI_OEM_ID_SIZE)) |
105 | && (!oem_table_id[0] | 105 | && (!oem_table_id[0] |
106 | || !memcmp(acpi_gbl_root_table_list.tables[i].pointer-> | 106 | || !memcmp(acpi_gbl_root_table_list.tables[i].pointer-> |
107 | oem_table_id, header.oem_table_id, | 107 | oem_table_id, header.oem_table_id, |
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c index be6642bf6366..ef1ffd36ab3f 100644 --- a/drivers/acpi/acpica/tbinstal.c +++ b/drivers/acpi/acpica/tbinstal.c | |||
@@ -120,7 +120,7 @@ acpi_tb_install_standard_table(acpi_physical_address address, | |||
120 | */ | 120 | */ |
121 | if (!reload && | 121 | if (!reload && |
122 | acpi_gbl_disable_ssdt_table_install && | 122 | acpi_gbl_disable_ssdt_table_install && |
123 | ACPI_COMPARE_NAME(&new_table_desc.signature, ACPI_SIG_SSDT)) { | 123 | ACPI_COMPARE_NAMESEG(&new_table_desc.signature, ACPI_SIG_SSDT)) { |
124 | ACPI_INFO(("Ignoring installation of %4.4s at %8.8X%8.8X", | 124 | ACPI_INFO(("Ignoring installation of %4.4s at %8.8X%8.8X", |
125 | new_table_desc.signature.ascii, | 125 | new_table_desc.signature.ascii, |
126 | ACPI_FORMAT_UINT64(address))); | 126 | ACPI_FORMAT_UINT64(address))); |
diff --git a/drivers/acpi/acpica/tbprint.c b/drivers/acpi/acpica/tbprint.c index 9b5df95d881b..4764f849cb78 100644 --- a/drivers/acpi/acpica/tbprint.c +++ b/drivers/acpi/acpica/tbprint.c | |||
@@ -69,10 +69,10 @@ acpi_tb_cleanup_table_header(struct acpi_table_header *out_header, | |||
69 | 69 | ||
70 | memcpy(out_header, header, sizeof(struct acpi_table_header)); | 70 | memcpy(out_header, header, sizeof(struct acpi_table_header)); |
71 | 71 | ||
72 | acpi_tb_fix_string(out_header->signature, ACPI_NAME_SIZE); | 72 | acpi_tb_fix_string(out_header->signature, ACPI_NAMESEG_SIZE); |
73 | acpi_tb_fix_string(out_header->oem_id, ACPI_OEM_ID_SIZE); | 73 | acpi_tb_fix_string(out_header->oem_id, ACPI_OEM_ID_SIZE); |
74 | acpi_tb_fix_string(out_header->oem_table_id, ACPI_OEM_TABLE_ID_SIZE); | 74 | acpi_tb_fix_string(out_header->oem_table_id, ACPI_OEM_TABLE_ID_SIZE); |
75 | acpi_tb_fix_string(out_header->asl_compiler_id, ACPI_NAME_SIZE); | 75 | acpi_tb_fix_string(out_header->asl_compiler_id, ACPI_NAMESEG_SIZE); |
76 | } | 76 | } |
77 | 77 | ||
78 | /******************************************************************************* | 78 | /******************************************************************************* |
@@ -94,7 +94,7 @@ acpi_tb_print_table_header(acpi_physical_address address, | |||
94 | { | 94 | { |
95 | struct acpi_table_header local_header; | 95 | struct acpi_table_header local_header; |
96 | 96 | ||
97 | if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_FACS)) { | 97 | if (ACPI_COMPARE_NAMESEG(header->signature, ACPI_SIG_FACS)) { |
98 | 98 | ||
99 | /* FACS only has signature and length fields */ | 99 | /* FACS only has signature and length fields */ |
100 | 100 | ||
@@ -158,8 +158,8 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length) | |||
158 | * They are the odd tables, have no standard ACPI header and no checksum | 158 | * They are the odd tables, have no standard ACPI header and no checksum |
159 | */ | 159 | */ |
160 | 160 | ||
161 | if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_S3PT) || | 161 | if (ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_S3PT) || |
162 | ACPI_COMPARE_NAME(table->signature, ACPI_SIG_FACS)) { | 162 | ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_FACS)) { |
163 | return (AE_OK); | 163 | return (AE_OK); |
164 | } | 164 | } |
165 | 165 | ||
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index 2469e01310e2..c5f0b8ec70cc 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c | |||
@@ -332,9 +332,9 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address) | |||
332 | &table_index); | 332 | &table_index); |
333 | 333 | ||
334 | if (ACPI_SUCCESS(status) && | 334 | if (ACPI_SUCCESS(status) && |
335 | ACPI_COMPARE_NAME(&acpi_gbl_root_table_list. | 335 | ACPI_COMPARE_NAMESEG(&acpi_gbl_root_table_list. |
336 | tables[table_index].signature, | 336 | tables[table_index].signature, |
337 | ACPI_SIG_FADT)) { | 337 | ACPI_SIG_FADT)) { |
338 | acpi_gbl_fadt_index = table_index; | 338 | acpi_gbl_fadt_index = table_index; |
339 | acpi_tb_parse_fadt(); | 339 | acpi_tb_parse_fadt(); |
340 | } | 340 | } |
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c index 36592888f0e7..1640685bf4ae 100644 --- a/drivers/acpi/acpica/tbxface.c +++ b/drivers/acpi/acpica/tbxface.c | |||
@@ -230,7 +230,7 @@ acpi_get_table_header(char *signature, | |||
230 | 230 | ||
231 | for (i = 0, j = 0; i < acpi_gbl_root_table_list.current_table_count; | 231 | for (i = 0, j = 0; i < acpi_gbl_root_table_list.current_table_count; |
232 | i++) { | 232 | i++) { |
233 | if (!ACPI_COMPARE_NAME | 233 | if (!ACPI_COMPARE_NAMESEG |
234 | (&(acpi_gbl_root_table_list.tables[i].signature), | 234 | (&(acpi_gbl_root_table_list.tables[i].signature), |
235 | signature)) { | 235 | signature)) { |
236 | continue; | 236 | continue; |
@@ -323,7 +323,7 @@ acpi_get_table(char *signature, | |||
323 | i++) { | 323 | i++) { |
324 | table_desc = &acpi_gbl_root_table_list.tables[i]; | 324 | table_desc = &acpi_gbl_root_table_list.tables[i]; |
325 | 325 | ||
326 | if (!ACPI_COMPARE_NAME(&table_desc->signature, signature)) { | 326 | if (!ACPI_COMPARE_NAMESEG(&table_desc->signature, signature)) { |
327 | continue; | 327 | continue; |
328 | } | 328 | } |
329 | 329 | ||
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c index 1a2592cc3245..4f30f06a6f78 100644 --- a/drivers/acpi/acpica/tbxfload.c +++ b/drivers/acpi/acpica/tbxfload.c | |||
@@ -118,7 +118,7 @@ acpi_status acpi_tb_load_namespace(void) | |||
118 | table = &acpi_gbl_root_table_list.tables[acpi_gbl_dsdt_index]; | 118 | table = &acpi_gbl_root_table_list.tables[acpi_gbl_dsdt_index]; |
119 | 119 | ||
120 | if (!acpi_gbl_root_table_list.current_table_count || | 120 | if (!acpi_gbl_root_table_list.current_table_count || |
121 | !ACPI_COMPARE_NAME(table->signature.ascii, ACPI_SIG_DSDT) || | 121 | !ACPI_COMPARE_NAMESEG(table->signature.ascii, ACPI_SIG_DSDT) || |
122 | ACPI_FAILURE(acpi_tb_validate_table(table))) { | 122 | ACPI_FAILURE(acpi_tb_validate_table(table))) { |
123 | status = AE_NO_ACPI_TABLES; | 123 | status = AE_NO_ACPI_TABLES; |
124 | goto unlock_and_exit; | 124 | goto unlock_and_exit; |
@@ -170,11 +170,12 @@ acpi_status acpi_tb_load_namespace(void) | |||
170 | table = &acpi_gbl_root_table_list.tables[i]; | 170 | table = &acpi_gbl_root_table_list.tables[i]; |
171 | 171 | ||
172 | if (!table->address || | 172 | if (!table->address || |
173 | (!ACPI_COMPARE_NAME(table->signature.ascii, ACPI_SIG_SSDT) | 173 | (!ACPI_COMPARE_NAMESEG |
174 | && !ACPI_COMPARE_NAME(table->signature.ascii, | 174 | (table->signature.ascii, ACPI_SIG_SSDT) |
175 | ACPI_SIG_PSDT) | 175 | && !ACPI_COMPARE_NAMESEG(table->signature.ascii, |
176 | && !ACPI_COMPARE_NAME(table->signature.ascii, | 176 | ACPI_SIG_PSDT) |
177 | ACPI_SIG_OSDT)) | 177 | && !ACPI_COMPARE_NAMESEG(table->signature.ascii, |
178 | ACPI_SIG_OSDT)) | ||
178 | || ACPI_FAILURE(acpi_tb_validate_table(table))) { | 179 | || ACPI_FAILURE(acpi_tb_validate_table(table))) { |
179 | continue; | 180 | continue; |
180 | } | 181 | } |
@@ -364,7 +365,7 @@ acpi_status acpi_unload_parent_table(acpi_handle object) | |||
364 | * only these types can contain AML and thus are the only types | 365 | * only these types can contain AML and thus are the only types |
365 | * that can create namespace objects. | 366 | * that can create namespace objects. |
366 | */ | 367 | */ |
367 | if (ACPI_COMPARE_NAME | 368 | if (ACPI_COMPARE_NAMESEG |
368 | (acpi_gbl_root_table_list.tables[i].signature.ascii, | 369 | (acpi_gbl_root_table_list.tables[i].signature.ascii, |
369 | ACPI_SIG_DSDT)) { | 370 | ACPI_SIG_DSDT)) { |
370 | status = AE_TYPE; | 371 | status = AE_TYPE; |
diff --git a/drivers/acpi/acpica/utascii.c b/drivers/acpi/acpica/utascii.c index 79d7426fd7bf..f6cd7d4f698b 100644 --- a/drivers/acpi/acpica/utascii.c +++ b/drivers/acpi/acpica/utascii.c | |||
@@ -30,7 +30,7 @@ u8 acpi_ut_valid_nameseg(char *name) | |||
30 | 30 | ||
31 | /* Validate each character in the signature */ | 31 | /* Validate each character in the signature */ |
32 | 32 | ||
33 | for (i = 0; i < ACPI_NAME_SIZE; i++) { | 33 | for (i = 0; i < ACPI_NAMESEG_SIZE; i++) { |
34 | if (!acpi_ut_valid_name_char(name[i], i)) { | 34 | if (!acpi_ut_valid_name_char(name[i], i)) { |
35 | return (FALSE); | 35 | return (FALSE); |
36 | } | 36 | } |
diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c index ad9f77eb554f..65beaa237669 100644 --- a/drivers/acpi/acpica/utdecode.c +++ b/drivers/acpi/acpica/utdecode.c | |||
@@ -78,7 +78,7 @@ const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = { | |||
78 | "IPMI", /* 0x07 */ | 78 | "IPMI", /* 0x07 */ |
79 | "GeneralPurposeIo", /* 0x08 */ | 79 | "GeneralPurposeIo", /* 0x08 */ |
80 | "GenericSerialBus", /* 0x09 */ | 80 | "GenericSerialBus", /* 0x09 */ |
81 | "PCC" /* 0x0A */ | 81 | "PlatformCommChannel" /* 0x0A */ |
82 | }; | 82 | }; |
83 | 83 | ||
84 | const char *acpi_ut_get_region_name(u8 space_id) | 84 | const char *acpi_ut_get_region_name(u8 space_id) |
@@ -239,7 +239,7 @@ const char *acpi_ut_get_node_name(void *object) | |||
239 | { | 239 | { |
240 | struct acpi_namespace_node *node = (struct acpi_namespace_node *)object; | 240 | struct acpi_namespace_node *node = (struct acpi_namespace_node *)object; |
241 | 241 | ||
242 | /* Must return a string of exactly 4 characters == ACPI_NAME_SIZE */ | 242 | /* Must return a string of exactly 4 characters == ACPI_NAMESEG_SIZE */ |
243 | 243 | ||
244 | if (!object) { | 244 | if (!object) { |
245 | return ("NULL"); | 245 | return ("NULL"); |
diff --git a/drivers/acpi/acpica/utmisc.c b/drivers/acpi/acpica/utmisc.c index afaadc73196b..8638efacdbf4 100644 --- a/drivers/acpi/acpica/utmisc.c +++ b/drivers/acpi/acpica/utmisc.c | |||
@@ -59,10 +59,10 @@ u8 acpi_ut_is_aml_table(struct acpi_table_header *table) | |||
59 | 59 | ||
60 | /* These are the only tables that contain executable AML */ | 60 | /* These are the only tables that contain executable AML */ |
61 | 61 | ||
62 | if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_DSDT) || | 62 | if (ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_DSDT) || |
63 | ACPI_COMPARE_NAME(table->signature, ACPI_SIG_PSDT) || | 63 | ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_PSDT) || |
64 | ACPI_COMPARE_NAME(table->signature, ACPI_SIG_SSDT) || | 64 | ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_SSDT) || |
65 | ACPI_COMPARE_NAME(table->signature, ACPI_SIG_OSDT) || | 65 | ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_OSDT) || |
66 | ACPI_IS_OEM_SIG(table->signature)) { | 66 | ACPI_IS_OEM_SIG(table->signature)) { |
67 | return (TRUE); | 67 | return (TRUE); |
68 | } | 68 | } |
diff --git a/drivers/acpi/acpica/utpredef.c b/drivers/acpi/acpica/utpredef.c index a9f08f43c685..1b0f68f5ed8c 100644 --- a/drivers/acpi/acpica/utpredef.c +++ b/drivers/acpi/acpica/utpredef.c | |||
@@ -84,7 +84,7 @@ const union acpi_predefined_info *acpi_ut_match_predefined_method(char *name) | |||
84 | 84 | ||
85 | this_name = acpi_gbl_predefined_methods; | 85 | this_name = acpi_gbl_predefined_methods; |
86 | while (this_name->info.name[0]) { | 86 | while (this_name->info.name[0]) { |
87 | if (ACPI_COMPARE_NAME(name, this_name->info.name)) { | 87 | if (ACPI_COMPARE_NAMESEG(name, this_name->info.name)) { |
88 | return (this_name); | 88 | return (this_name); |
89 | } | 89 | } |
90 | 90 | ||
@@ -201,7 +201,7 @@ const union acpi_predefined_info *acpi_ut_match_resource_name(char *name) | |||
201 | 201 | ||
202 | this_name = acpi_gbl_resource_names; | 202 | this_name = acpi_gbl_resource_names; |
203 | while (this_name->info.name[0]) { | 203 | while (this_name->info.name[0]) { |
204 | if (ACPI_COMPARE_NAME(name, this_name->info.name)) { | 204 | if (ACPI_COMPARE_NAMESEG(name, this_name->info.name)) { |
205 | return (this_name); | 205 | return (this_name); |
206 | } | 206 | } |
207 | 207 | ||
diff --git a/drivers/acpi/acpica/utstring.c b/drivers/acpi/acpica/utstring.c index 5bef0b059406..c39b5483045d 100644 --- a/drivers/acpi/acpica/utstring.c +++ b/drivers/acpi/acpica/utstring.c | |||
@@ -141,15 +141,15 @@ void acpi_ut_repair_name(char *name) | |||
141 | * Special case for the root node. This can happen if we get an | 141 | * Special case for the root node. This can happen if we get an |
142 | * error during the execution of module-level code. | 142 | * error during the execution of module-level code. |
143 | */ | 143 | */ |
144 | if (ACPI_COMPARE_NAME(name, ACPI_ROOT_PATHNAME)) { | 144 | if (ACPI_COMPARE_NAMESEG(name, ACPI_ROOT_PATHNAME)) { |
145 | return; | 145 | return; |
146 | } | 146 | } |
147 | 147 | ||
148 | ACPI_MOVE_NAME(&original_name, name); | 148 | ACPI_COPY_NAMESEG(&original_name, name); |
149 | 149 | ||
150 | /* Check each character in the name */ | 150 | /* Check each character in the name */ |
151 | 151 | ||
152 | for (i = 0; i < ACPI_NAME_SIZE; i++) { | 152 | for (i = 0; i < ACPI_NAMESEG_SIZE; i++) { |
153 | if (acpi_ut_valid_name_char(name[i], i)) { | 153 | if (acpi_ut_valid_name_char(name[i], i)) { |
154 | continue; | 154 | continue; |
155 | } | 155 | } |
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index a19ff3977ac4..623998a8d722 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
@@ -456,8 +456,11 @@ static int acpi_button_resume(struct device *dev) | |||
456 | struct acpi_button *button = acpi_driver_data(device); | 456 | struct acpi_button *button = acpi_driver_data(device); |
457 | 457 | ||
458 | button->suspended = false; | 458 | button->suspended = false; |
459 | if (button->type == ACPI_BUTTON_TYPE_LID && button->input->users) | 459 | if (button->type == ACPI_BUTTON_TYPE_LID && button->input->users) { |
460 | button->last_state = !!acpi_lid_evaluate_state(device); | ||
461 | button->last_time = ktime_get(); | ||
460 | acpi_lid_initialize_state(device); | 462 | acpi_lid_initialize_state(device); |
463 | } | ||
461 | return 0; | 464 | return 0; |
462 | } | 465 | } |
463 | #endif | 466 | #endif |
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index d4244e7d0e38..653642a4cbdd 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c | |||
@@ -81,9 +81,9 @@ struct cppc_pcc_data { | |||
81 | int refcount; | 81 | int refcount; |
82 | }; | 82 | }; |
83 | 83 | ||
84 | /* Array to represent the PCC channel per subspace id */ | 84 | /* Array to represent the PCC channel per subspace ID */ |
85 | static struct cppc_pcc_data *pcc_data[MAX_PCC_SUBSPACES]; | 85 | static struct cppc_pcc_data *pcc_data[MAX_PCC_SUBSPACES]; |
86 | /* The cpu_pcc_subspace_idx containsper CPU subspace id */ | 86 | /* The cpu_pcc_subspace_idx contains per CPU subspace ID */ |
87 | static DEFINE_PER_CPU(int, cpu_pcc_subspace_idx); | 87 | static DEFINE_PER_CPU(int, cpu_pcc_subspace_idx); |
88 | 88 | ||
89 | /* | 89 | /* |
@@ -436,7 +436,7 @@ int acpi_get_psd_map(struct cppc_cpudata **all_cpu_data) | |||
436 | return -ENOMEM; | 436 | return -ENOMEM; |
437 | 437 | ||
438 | /* | 438 | /* |
439 | * Now that we have _PSD data from all CPUs, lets setup P-state | 439 | * Now that we have _PSD data from all CPUs, let's setup P-state |
440 | * domain info. | 440 | * domain info. |
441 | */ | 441 | */ |
442 | for_each_possible_cpu(i) { | 442 | for_each_possible_cpu(i) { |
@@ -588,7 +588,7 @@ static int register_pcc_channel(int pcc_ss_idx) | |||
588 | return -ENOMEM; | 588 | return -ENOMEM; |
589 | } | 589 | } |
590 | 590 | ||
591 | /* Set flag so that we dont come here for each CPU. */ | 591 | /* Set flag so that we don't come here for each CPU. */ |
592 | pcc_data[pcc_ss_idx]->pcc_channel_acquired = true; | 592 | pcc_data[pcc_ss_idx]->pcc_channel_acquired = true; |
593 | } | 593 | } |
594 | 594 | ||
@@ -613,7 +613,7 @@ bool __weak cpc_ffh_supported(void) | |||
613 | * | 613 | * |
614 | * Check and allocate the cppc_pcc_data memory. | 614 | * Check and allocate the cppc_pcc_data memory. |
615 | * In some processor configurations it is possible that same subspace | 615 | * In some processor configurations it is possible that same subspace |
616 | * is shared between multiple CPU's. This is seen especially in CPU's | 616 | * is shared between multiple CPUs. This is seen especially in CPUs |
617 | * with hardware multi-threading support. | 617 | * with hardware multi-threading support. |
618 | * | 618 | * |
619 | * Return: 0 for success, errno for failure | 619 | * Return: 0 for success, errno for failure |
@@ -711,7 +711,7 @@ static bool is_cppc_supported(int revision, int num_ent) | |||
711 | 711 | ||
712 | /** | 712 | /** |
713 | * acpi_cppc_processor_probe - Search for per CPU _CPC objects. | 713 | * acpi_cppc_processor_probe - Search for per CPU _CPC objects. |
714 | * @pr: Ptr to acpi_processor containing this CPUs logical Id. | 714 | * @pr: Ptr to acpi_processor containing this CPU's logical ID. |
715 | * | 715 | * |
716 | * Return: 0 for success or negative value for err. | 716 | * Return: 0 for success or negative value for err. |
717 | */ | 717 | */ |
@@ -728,7 +728,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) | |||
728 | acpi_status status; | 728 | acpi_status status; |
729 | int ret = -EFAULT; | 729 | int ret = -EFAULT; |
730 | 730 | ||
731 | /* Parse the ACPI _CPC table for this cpu. */ | 731 | /* Parse the ACPI _CPC table for this CPU. */ |
732 | status = acpi_evaluate_object_typed(handle, "_CPC", NULL, &output, | 732 | status = acpi_evaluate_object_typed(handle, "_CPC", NULL, &output, |
733 | ACPI_TYPE_PACKAGE); | 733 | ACPI_TYPE_PACKAGE); |
734 | if (ACPI_FAILURE(status)) { | 734 | if (ACPI_FAILURE(status)) { |
@@ -840,7 +840,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) | |||
840 | if (ret) | 840 | if (ret) |
841 | goto out_free; | 841 | goto out_free; |
842 | 842 | ||
843 | /* Register PCC channel once for all PCC subspace id. */ | 843 | /* Register PCC channel once for all PCC subspace ID. */ |
844 | if (pcc_subspace_id >= 0 && !pcc_data[pcc_subspace_id]->pcc_channel_acquired) { | 844 | if (pcc_subspace_id >= 0 && !pcc_data[pcc_subspace_id]->pcc_channel_acquired) { |
845 | ret = register_pcc_channel(pcc_subspace_id); | 845 | ret = register_pcc_channel(pcc_subspace_id); |
846 | if (ret) | 846 | if (ret) |
@@ -860,7 +860,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) | |||
860 | goto out_free; | 860 | goto out_free; |
861 | } | 861 | } |
862 | 862 | ||
863 | /* Plug PSD data into this CPUs CPC descriptor. */ | 863 | /* Plug PSD data into this CPU's CPC descriptor. */ |
864 | per_cpu(cpc_desc_ptr, pr->id) = cpc_ptr; | 864 | per_cpu(cpc_desc_ptr, pr->id) = cpc_ptr; |
865 | 865 | ||
866 | ret = kobject_init_and_add(&cpc_ptr->kobj, &cppc_ktype, &cpu_dev->kobj, | 866 | ret = kobject_init_and_add(&cpc_ptr->kobj, &cppc_ktype, &cpu_dev->kobj, |
@@ -891,7 +891,7 @@ EXPORT_SYMBOL_GPL(acpi_cppc_processor_probe); | |||
891 | 891 | ||
892 | /** | 892 | /** |
893 | * acpi_cppc_processor_exit - Cleanup CPC structs. | 893 | * acpi_cppc_processor_exit - Cleanup CPC structs. |
894 | * @pr: Ptr to acpi_processor containing this CPUs logical Id. | 894 | * @pr: Ptr to acpi_processor containing this CPU's logical ID. |
895 | * | 895 | * |
896 | * Return: Void | 896 | * Return: Void |
897 | */ | 897 | */ |
@@ -931,7 +931,7 @@ EXPORT_SYMBOL_GPL(acpi_cppc_processor_exit); | |||
931 | 931 | ||
932 | /** | 932 | /** |
933 | * cpc_read_ffh() - Read FFH register | 933 | * cpc_read_ffh() - Read FFH register |
934 | * @cpunum: cpu number to read | 934 | * @cpunum: CPU number to read |
935 | * @reg: cppc register information | 935 | * @reg: cppc register information |
936 | * @val: place holder for return value | 936 | * @val: place holder for return value |
937 | * | 937 | * |
@@ -946,7 +946,7 @@ int __weak cpc_read_ffh(int cpunum, struct cpc_reg *reg, u64 *val) | |||
946 | 946 | ||
947 | /** | 947 | /** |
948 | * cpc_write_ffh() - Write FFH register | 948 | * cpc_write_ffh() - Write FFH register |
949 | * @cpunum: cpu number to write | 949 | * @cpunum: CPU number to write |
950 | * @reg: cppc register information | 950 | * @reg: cppc register information |
951 | * @val: value to write | 951 | * @val: value to write |
952 | * | 952 | * |
@@ -1093,7 +1093,7 @@ int cppc_get_desired_perf(int cpunum, u64 *desired_perf) | |||
1093 | EXPORT_SYMBOL_GPL(cppc_get_desired_perf); | 1093 | EXPORT_SYMBOL_GPL(cppc_get_desired_perf); |
1094 | 1094 | ||
1095 | /** | 1095 | /** |
1096 | * cppc_get_perf_caps - Get a CPUs performance capabilities. | 1096 | * cppc_get_perf_caps - Get a CPU's performance capabilities. |
1097 | * @cpunum: CPU from which to get capabilities info. | 1097 | * @cpunum: CPU from which to get capabilities info. |
1098 | * @perf_caps: ptr to cppc_perf_caps. See cppc_acpi.h | 1098 | * @perf_caps: ptr to cppc_perf_caps. See cppc_acpi.h |
1099 | * | 1099 | * |
@@ -1183,7 +1183,7 @@ out_err: | |||
1183 | EXPORT_SYMBOL_GPL(cppc_get_perf_caps); | 1183 | EXPORT_SYMBOL_GPL(cppc_get_perf_caps); |
1184 | 1184 | ||
1185 | /** | 1185 | /** |
1186 | * cppc_get_perf_ctrs - Read a CPUs performance feedback counters. | 1186 | * cppc_get_perf_ctrs - Read a CPU's performance feedback counters. |
1187 | * @cpunum: CPU from which to read counters. | 1187 | * @cpunum: CPU from which to read counters. |
1188 | * @perf_fb_ctrs: ptr to cppc_perf_fb_ctrs. See cppc_acpi.h | 1188 | * @perf_fb_ctrs: ptr to cppc_perf_fb_ctrs. See cppc_acpi.h |
1189 | * | 1189 | * |
@@ -1210,7 +1210,7 @@ int cppc_get_perf_ctrs(int cpunum, struct cppc_perf_fb_ctrs *perf_fb_ctrs) | |||
1210 | ctr_wrap_reg = &cpc_desc->cpc_regs[CTR_WRAP_TIME]; | 1210 | ctr_wrap_reg = &cpc_desc->cpc_regs[CTR_WRAP_TIME]; |
1211 | 1211 | ||
1212 | /* | 1212 | /* |
1213 | * If refernce perf register is not supported then we should | 1213 | * If reference perf register is not supported then we should |
1214 | * use the nominal perf value | 1214 | * use the nominal perf value |
1215 | */ | 1215 | */ |
1216 | if (!CPC_SUPPORTED(ref_perf_reg)) | 1216 | if (!CPC_SUPPORTED(ref_perf_reg)) |
@@ -1263,7 +1263,7 @@ out_err: | |||
1263 | EXPORT_SYMBOL_GPL(cppc_get_perf_ctrs); | 1263 | EXPORT_SYMBOL_GPL(cppc_get_perf_ctrs); |
1264 | 1264 | ||
1265 | /** | 1265 | /** |
1266 | * cppc_set_perf - Set a CPUs performance controls. | 1266 | * cppc_set_perf - Set a CPU's performance controls. |
1267 | * @cpu: CPU for which to set performance controls. | 1267 | * @cpu: CPU for which to set performance controls. |
1268 | * @perf_ctrls: ptr to cppc_perf_ctrls. See cppc_acpi.h | 1268 | * @perf_ctrls: ptr to cppc_perf_ctrls. See cppc_acpi.h |
1269 | * | 1269 | * |
@@ -1344,7 +1344,7 @@ int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls) | |||
1344 | * executing the Phase-II. | 1344 | * executing the Phase-II. |
1345 | * 2. Some other CPU has beaten this CPU to successfully execute the | 1345 | * 2. Some other CPU has beaten this CPU to successfully execute the |
1346 | * write_trylock and has already acquired the write_lock. We know for a | 1346 | * write_trylock and has already acquired the write_lock. We know for a |
1347 | * fact it(other CPU acquiring the write_lock) couldn't have happened | 1347 | * fact it (other CPU acquiring the write_lock) couldn't have happened |
1348 | * before this CPU's Phase-I as we held the read_lock. | 1348 | * before this CPU's Phase-I as we held the read_lock. |
1349 | * 3. Some other CPU executing pcc CMD_READ has stolen the | 1349 | * 3. Some other CPU executing pcc CMD_READ has stolen the |
1350 | * down_write, in which case, send_pcc_cmd will check for pending | 1350 | * down_write, in which case, send_pcc_cmd will check for pending |
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index 824ae985ad93..5b50f884712c 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c | |||
@@ -728,6 +728,9 @@ static int __acpi_device_wakeup_enable(struct acpi_device *adev, | |||
728 | goto out; | 728 | goto out; |
729 | } | 729 | } |
730 | 730 | ||
731 | acpi_handle_debug(adev->handle, "GPE%2X enabled for wakeup\n", | ||
732 | (unsigned int)wakeup->gpe_number); | ||
733 | |||
731 | inc: | 734 | inc: |
732 | wakeup->enable_count++; | 735 | wakeup->enable_count++; |
733 | 736 | ||
diff --git a/drivers/acpi/dptf/dptf_power.c b/drivers/acpi/dptf/dptf_power.c index e1c242568341..0c081390930a 100644 --- a/drivers/acpi/dptf/dptf_power.c +++ b/drivers/acpi/dptf/dptf_power.c | |||
@@ -31,8 +31,7 @@ static ssize_t name##_show(struct device *dev,\ | |||
31 | struct device_attribute *attr,\ | 31 | struct device_attribute *attr,\ |
32 | char *buf)\ | 32 | char *buf)\ |
33 | {\ | 33 | {\ |
34 | struct platform_device *pdev = to_platform_device(dev);\ | 34 | struct acpi_device *acpi_dev = dev_get_drvdata(dev);\ |
35 | struct acpi_device *acpi_dev = platform_get_drvdata(pdev);\ | ||
36 | unsigned long long val;\ | 35 | unsigned long long val;\ |
37 | acpi_status status;\ | 36 | acpi_status status;\ |
38 | \ | 37 | \ |
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c index 5a127f3f2d5c..47f21599f2ab 100644 --- a/drivers/acpi/event.c +++ b/drivers/acpi/event.c | |||
@@ -131,8 +131,8 @@ int acpi_bus_generate_netlink_event(const char *device_class, | |||
131 | event = nla_data(attr); | 131 | event = nla_data(attr); |
132 | memset(event, 0, sizeof(struct acpi_genl_event)); | 132 | memset(event, 0, sizeof(struct acpi_genl_event)); |
133 | 133 | ||
134 | strcpy(event->device_class, device_class); | 134 | strscpy(event->device_class, device_class, sizeof(event->device_class)); |
135 | strcpy(event->bus_id, bus_id); | 135 | strscpy(event->bus_id, bus_id, sizeof(event->bus_id)); |
136 | event->type = type; | 136 | event->type = type; |
137 | event->data = data; | 137 | event->data = data; |
138 | 138 | ||
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 665e93ca0b40..87db3e124725 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c | |||
@@ -535,12 +535,12 @@ int acpi_device_sleep_wake(struct acpi_device *dev, | |||
535 | /* | 535 | /* |
536 | * Try to execute _DSW first. | 536 | * Try to execute _DSW first. |
537 | * | 537 | * |
538 | * Three agruments are needed for the _DSW object: | 538 | * Three arguments are needed for the _DSW object: |
539 | * Argument 0: enable/disable the wake capabilities | 539 | * Argument 0: enable/disable the wake capabilities |
540 | * Argument 1: target system state | 540 | * Argument 1: target system state |
541 | * Argument 2: target device state | 541 | * Argument 2: target device state |
542 | * When _DSW object is called to disable the wake capabilities, maybe | 542 | * When _DSW object is called to disable the wake capabilities, maybe |
543 | * the first argument is filled. The values of the other two agruments | 543 | * the first argument is filled. The values of the other two arguments |
544 | * are meaningless. | 544 | * are meaningless. |
545 | */ | 545 | */ |
546 | in_arg[0].type = ACPI_TYPE_INTEGER; | 546 | in_arg[0].type = ACPI_TYPE_INTEGER; |
diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c index 065c4fc245d1..b72e6afaa8fb 100644 --- a/drivers/acpi/pptt.c +++ b/drivers/acpi/pptt.c | |||
@@ -164,7 +164,7 @@ static struct acpi_pptt_cache *acpi_find_cache_level(struct acpi_table_header *t | |||
164 | } | 164 | } |
165 | 165 | ||
166 | /** | 166 | /** |
167 | * acpi_count_levels() - Given a PPTT table, and a cpu node, count the caches | 167 | * acpi_count_levels() - Given a PPTT table, and a CPU node, count the caches |
168 | * @table_hdr: Pointer to the head of the PPTT table | 168 | * @table_hdr: Pointer to the head of the PPTT table |
169 | * @cpu_node: processor node we wish to count caches for | 169 | * @cpu_node: processor node we wish to count caches for |
170 | * | 170 | * |
@@ -235,7 +235,7 @@ static int acpi_pptt_leaf_node(struct acpi_table_header *table_hdr, | |||
235 | /** | 235 | /** |
236 | * acpi_find_processor_node() - Given a PPTT table find the requested processor | 236 | * acpi_find_processor_node() - Given a PPTT table find the requested processor |
237 | * @table_hdr: Pointer to the head of the PPTT table | 237 | * @table_hdr: Pointer to the head of the PPTT table |
238 | * @acpi_cpu_id: cpu we are searching for | 238 | * @acpi_cpu_id: CPU we are searching for |
239 | * | 239 | * |
240 | * Find the subtable entry describing the provided processor. | 240 | * Find the subtable entry describing the provided processor. |
241 | * This is done by iterating the PPTT table looking for processor nodes | 241 | * This is done by iterating the PPTT table looking for processor nodes |
@@ -456,21 +456,21 @@ static struct acpi_pptt_processor *acpi_find_processor_package_id(struct acpi_ta | |||
456 | 456 | ||
457 | static void acpi_pptt_warn_missing(void) | 457 | static void acpi_pptt_warn_missing(void) |
458 | { | 458 | { |
459 | pr_warn_once("No PPTT table found, cpu and cache topology may be inaccurate\n"); | 459 | pr_warn_once("No PPTT table found, CPU and cache topology may be inaccurate\n"); |
460 | } | 460 | } |
461 | 461 | ||
462 | /** | 462 | /** |
463 | * topology_get_acpi_cpu_tag() - Find a unique topology value for a feature | 463 | * topology_get_acpi_cpu_tag() - Find a unique topology value for a feature |
464 | * @table: Pointer to the head of the PPTT table | 464 | * @table: Pointer to the head of the PPTT table |
465 | * @cpu: Kernel logical cpu number | 465 | * @cpu: Kernel logical CPU number |
466 | * @level: A level that terminates the search | 466 | * @level: A level that terminates the search |
467 | * @flag: A flag which terminates the search | 467 | * @flag: A flag which terminates the search |
468 | * | 468 | * |
469 | * Get a unique value given a cpu, and a topology level, that can be | 469 | * Get a unique value given a CPU, and a topology level, that can be |
470 | * matched to determine which cpus share common topological features | 470 | * matched to determine which cpus share common topological features |
471 | * at that level. | 471 | * at that level. |
472 | * | 472 | * |
473 | * Return: Unique value, or -ENOENT if unable to locate cpu | 473 | * Return: Unique value, or -ENOENT if unable to locate CPU |
474 | */ | 474 | */ |
475 | static int topology_get_acpi_cpu_tag(struct acpi_table_header *table, | 475 | static int topology_get_acpi_cpu_tag(struct acpi_table_header *table, |
476 | unsigned int cpu, int level, int flag) | 476 | unsigned int cpu, int level, int flag) |
@@ -510,7 +510,7 @@ static int find_acpi_cpu_topology_tag(unsigned int cpu, int level, int flag) | |||
510 | return -ENOENT; | 510 | return -ENOENT; |
511 | } | 511 | } |
512 | retval = topology_get_acpi_cpu_tag(table, cpu, level, flag); | 512 | retval = topology_get_acpi_cpu_tag(table, cpu, level, flag); |
513 | pr_debug("Topology Setup ACPI cpu %d, level %d ret = %d\n", | 513 | pr_debug("Topology Setup ACPI CPU %d, level %d ret = %d\n", |
514 | cpu, level, retval); | 514 | cpu, level, retval); |
515 | acpi_put_table(table); | 515 | acpi_put_table(table); |
516 | 516 | ||
@@ -519,9 +519,9 @@ static int find_acpi_cpu_topology_tag(unsigned int cpu, int level, int flag) | |||
519 | 519 | ||
520 | /** | 520 | /** |
521 | * acpi_find_last_cache_level() - Determines the number of cache levels for a PE | 521 | * acpi_find_last_cache_level() - Determines the number of cache levels for a PE |
522 | * @cpu: Kernel logical cpu number | 522 | * @cpu: Kernel logical CPU number |
523 | * | 523 | * |
524 | * Given a logical cpu number, returns the number of levels of cache represented | 524 | * Given a logical CPU number, returns the number of levels of cache represented |
525 | * in the PPTT. Errors caused by lack of a PPTT table, or otherwise, return 0 | 525 | * in the PPTT. Errors caused by lack of a PPTT table, or otherwise, return 0 |
526 | * indicating we didn't find any cache levels. | 526 | * indicating we didn't find any cache levels. |
527 | * | 527 | * |
@@ -534,7 +534,7 @@ int acpi_find_last_cache_level(unsigned int cpu) | |||
534 | int number_of_levels = 0; | 534 | int number_of_levels = 0; |
535 | acpi_status status; | 535 | acpi_status status; |
536 | 536 | ||
537 | pr_debug("Cache Setup find last level cpu=%d\n", cpu); | 537 | pr_debug("Cache Setup find last level CPU=%d\n", cpu); |
538 | 538 | ||
539 | acpi_cpu_id = get_acpi_id_for_cpu(cpu); | 539 | acpi_cpu_id = get_acpi_id_for_cpu(cpu); |
540 | status = acpi_get_table(ACPI_SIG_PPTT, 0, &table); | 540 | status = acpi_get_table(ACPI_SIG_PPTT, 0, &table); |
@@ -551,14 +551,14 @@ int acpi_find_last_cache_level(unsigned int cpu) | |||
551 | 551 | ||
552 | /** | 552 | /** |
553 | * cache_setup_acpi() - Override CPU cache topology with data from the PPTT | 553 | * cache_setup_acpi() - Override CPU cache topology with data from the PPTT |
554 | * @cpu: Kernel logical cpu number | 554 | * @cpu: Kernel logical CPU number |
555 | * | 555 | * |
556 | * Updates the global cache info provided by cpu_get_cacheinfo() | 556 | * Updates the global cache info provided by cpu_get_cacheinfo() |
557 | * when there are valid properties in the acpi_pptt_cache nodes. A | 557 | * when there are valid properties in the acpi_pptt_cache nodes. A |
558 | * successful parse may not result in any updates if none of the | 558 | * successful parse may not result in any updates if none of the |
559 | * cache levels have any valid flags set. Futher, a unique value is | 559 | * cache levels have any valid flags set. Further, a unique value is |
560 | * associated with each known CPU cache entry. This unique value | 560 | * associated with each known CPU cache entry. This unique value |
561 | * can be used to determine whether caches are shared between cpus. | 561 | * can be used to determine whether caches are shared between CPUs. |
562 | * | 562 | * |
563 | * Return: -ENOENT on failure to find table, or 0 on success | 563 | * Return: -ENOENT on failure to find table, or 0 on success |
564 | */ | 564 | */ |
@@ -567,7 +567,7 @@ int cache_setup_acpi(unsigned int cpu) | |||
567 | struct acpi_table_header *table; | 567 | struct acpi_table_header *table; |
568 | acpi_status status; | 568 | acpi_status status; |
569 | 569 | ||
570 | pr_debug("Cache Setup ACPI cpu %d\n", cpu); | 570 | pr_debug("Cache Setup ACPI CPU %d\n", cpu); |
571 | 571 | ||
572 | status = acpi_get_table(ACPI_SIG_PPTT, 0, &table); | 572 | status = acpi_get_table(ACPI_SIG_PPTT, 0, &table); |
573 | if (ACPI_FAILURE(status)) { | 573 | if (ACPI_FAILURE(status)) { |
@@ -582,8 +582,8 @@ int cache_setup_acpi(unsigned int cpu) | |||
582 | } | 582 | } |
583 | 583 | ||
584 | /** | 584 | /** |
585 | * find_acpi_cpu_topology() - Determine a unique topology value for a given cpu | 585 | * find_acpi_cpu_topology() - Determine a unique topology value for a given CPU |
586 | * @cpu: Kernel logical cpu number | 586 | * @cpu: Kernel logical CPU number |
587 | * @level: The topological level for which we would like a unique ID | 587 | * @level: The topological level for which we would like a unique ID |
588 | * | 588 | * |
589 | * Determine a topology unique ID for each thread/core/cluster/mc_grouping | 589 | * Determine a topology unique ID for each thread/core/cluster/mc_grouping |
@@ -596,7 +596,7 @@ int cache_setup_acpi(unsigned int cpu) | |||
596 | * other levels beyond this use a generated value to uniquely identify | 596 | * other levels beyond this use a generated value to uniquely identify |
597 | * a topological feature. | 597 | * a topological feature. |
598 | * | 598 | * |
599 | * Return: -ENOENT if the PPTT doesn't exist, or the cpu cannot be found. | 599 | * Return: -ENOENT if the PPTT doesn't exist, or the CPU cannot be found. |
600 | * Otherwise returns a value which represents a unique topological feature. | 600 | * Otherwise returns a value which represents a unique topological feature. |
601 | */ | 601 | */ |
602 | int find_acpi_cpu_topology(unsigned int cpu, int level) | 602 | int find_acpi_cpu_topology(unsigned int cpu, int level) |
@@ -606,12 +606,12 @@ int find_acpi_cpu_topology(unsigned int cpu, int level) | |||
606 | 606 | ||
607 | /** | 607 | /** |
608 | * find_acpi_cpu_cache_topology() - Determine a unique cache topology value | 608 | * find_acpi_cpu_cache_topology() - Determine a unique cache topology value |
609 | * @cpu: Kernel logical cpu number | 609 | * @cpu: Kernel logical CPU number |
610 | * @level: The cache level for which we would like a unique ID | 610 | * @level: The cache level for which we would like a unique ID |
611 | * | 611 | * |
612 | * Determine a unique ID for each unified cache in the system | 612 | * Determine a unique ID for each unified cache in the system |
613 | * | 613 | * |
614 | * Return: -ENOENT if the PPTT doesn't exist, or the cpu cannot be found. | 614 | * Return: -ENOENT if the PPTT doesn't exist, or the CPU cannot be found. |
615 | * Otherwise returns a value which represents a unique topological feature. | 615 | * Otherwise returns a value which represents a unique topological feature. |
616 | */ | 616 | */ |
617 | int find_acpi_cpu_cache_topology(unsigned int cpu, int level) | 617 | int find_acpi_cpu_cache_topology(unsigned int cpu, int level) |
@@ -643,17 +643,17 @@ int find_acpi_cpu_cache_topology(unsigned int cpu, int level) | |||
643 | 643 | ||
644 | 644 | ||
645 | /** | 645 | /** |
646 | * find_acpi_cpu_topology_package() - Determine a unique cpu package value | 646 | * find_acpi_cpu_topology_package() - Determine a unique CPU package value |
647 | * @cpu: Kernel logical cpu number | 647 | * @cpu: Kernel logical CPU number |
648 | * | 648 | * |
649 | * Determine a topology unique package ID for the given cpu. | 649 | * Determine a topology unique package ID for the given CPU. |
650 | * This ID can then be used to group peers, which will have matching ids. | 650 | * This ID can then be used to group peers, which will have matching ids. |
651 | * | 651 | * |
652 | * The search terminates when either a level is found with the PHYSICAL_PACKAGE | 652 | * The search terminates when either a level is found with the PHYSICAL_PACKAGE |
653 | * flag set or we reach a root node. | 653 | * flag set or we reach a root node. |
654 | * | 654 | * |
655 | * Return: -ENOENT if the PPTT doesn't exist, or the cpu cannot be found. | 655 | * Return: -ENOENT if the PPTT doesn't exist, or the CPU cannot be found. |
656 | * Otherwise returns a value which represents the package for this cpu. | 656 | * Otherwise returns a value which represents the package for this CPU. |
657 | */ | 657 | */ |
658 | int find_acpi_cpu_topology_package(unsigned int cpu) | 658 | int find_acpi_cpu_topology_package(unsigned int cpu) |
659 | { | 659 | { |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 446c959a8f08..b845dc3e0ba9 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -763,18 +763,16 @@ acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd) | |||
763 | } | 763 | } |
764 | EXPORT_SYMBOL_GPL(acpi_bus_get_ejd); | 764 | EXPORT_SYMBOL_GPL(acpi_bus_get_ejd); |
765 | 765 | ||
766 | static int acpi_bus_extract_wakeup_device_power_package(acpi_handle handle, | 766 | static int acpi_bus_extract_wakeup_device_power_package(struct acpi_device *dev) |
767 | struct acpi_device_wakeup *wakeup) | ||
768 | { | 767 | { |
768 | acpi_handle handle = dev->handle; | ||
769 | struct acpi_device_wakeup *wakeup = &dev->wakeup; | ||
769 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | 770 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
770 | union acpi_object *package = NULL; | 771 | union acpi_object *package = NULL; |
771 | union acpi_object *element = NULL; | 772 | union acpi_object *element = NULL; |
772 | acpi_status status; | 773 | acpi_status status; |
773 | int err = -ENODATA; | 774 | int err = -ENODATA; |
774 | 775 | ||
775 | if (!wakeup) | ||
776 | return -EINVAL; | ||
777 | |||
778 | INIT_LIST_HEAD(&wakeup->resources); | 776 | INIT_LIST_HEAD(&wakeup->resources); |
779 | 777 | ||
780 | /* _PRW */ | 778 | /* _PRW */ |
@@ -848,9 +846,9 @@ static int acpi_bus_extract_wakeup_device_power_package(acpi_handle handle, | |||
848 | static bool acpi_wakeup_gpe_init(struct acpi_device *device) | 846 | static bool acpi_wakeup_gpe_init(struct acpi_device *device) |
849 | { | 847 | { |
850 | static const struct acpi_device_id button_device_ids[] = { | 848 | static const struct acpi_device_id button_device_ids[] = { |
851 | {"PNP0C0C", 0}, | 849 | {"PNP0C0C", 0}, /* Power button */ |
852 | {"PNP0C0D", 0}, | 850 | {"PNP0C0D", 0}, /* Lid */ |
853 | {"PNP0C0E", 0}, | 851 | {"PNP0C0E", 0}, /* Sleep button */ |
854 | {"", 0}, | 852 | {"", 0}, |
855 | }; | 853 | }; |
856 | struct acpi_device_wakeup *wakeup = &device->wakeup; | 854 | struct acpi_device_wakeup *wakeup = &device->wakeup; |
@@ -883,8 +881,7 @@ static void acpi_bus_get_wakeup_device_flags(struct acpi_device *device) | |||
883 | if (!acpi_has_method(device->handle, "_PRW")) | 881 | if (!acpi_has_method(device->handle, "_PRW")) |
884 | return; | 882 | return; |
885 | 883 | ||
886 | err = acpi_bus_extract_wakeup_device_power_package(device->handle, | 884 | err = acpi_bus_extract_wakeup_device_power_package(device); |
887 | &device->wakeup); | ||
888 | if (err) { | 885 | if (err) { |
889 | dev_err(&device->dev, "_PRW evaluation error: %d\n", err); | 886 | dev_err(&device->dev, "_PRW evaluation error: %d\n", err); |
890 | return; | 887 | return; |
@@ -895,7 +892,7 @@ static void acpi_bus_get_wakeup_device_flags(struct acpi_device *device) | |||
895 | /* | 892 | /* |
896 | * Call _PSW/_DSW object to disable its ability to wake the sleeping | 893 | * Call _PSW/_DSW object to disable its ability to wake the sleeping |
897 | * system for the ACPI device with the _PRW object. | 894 | * system for the ACPI device with the _PRW object. |
898 | * The _PSW object is depreciated in ACPI 3.0 and is replaced by _DSW. | 895 | * The _PSW object is deprecated in ACPI 3.0 and is replaced by _DSW. |
899 | * So it is necessary to call _DSW object first. Only when it is not | 896 | * So it is necessary to call _DSW object first. Only when it is not |
900 | * present will the _PSW object used. | 897 | * present will the _PSW object used. |
901 | */ | 898 | */ |
@@ -2260,7 +2257,7 @@ int __init __acpi_probe_device_table(struct acpi_probe_entry *ap_head, int nr) | |||
2260 | 2257 | ||
2261 | mutex_lock(&acpi_probe_mutex); | 2258 | mutex_lock(&acpi_probe_mutex); |
2262 | for (ape = ap_head; nr; ape++, nr--) { | 2259 | for (ape = ap_head; nr; ape++, nr--) { |
2263 | if (ACPI_COMPARE_NAME(ACPI_SIG_MADT, ape->id)) { | 2260 | if (ACPI_COMPARE_NAMESEG(ACPI_SIG_MADT, ape->id)) { |
2264 | acpi_probe_count = 0; | 2261 | acpi_probe_count = 0; |
2265 | acpi_table_parse_madt(ape->type, acpi_match_madt, 0); | 2262 | acpi_table_parse_madt(ape->type, acpi_match_madt, 0); |
2266 | count += acpi_probe_count; | 2263 | count += acpi_probe_count; |
diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c index c336784d0bcb..b34d05e365b7 100644 --- a/drivers/acpi/spcr.c +++ b/drivers/acpi/spcr.c | |||
@@ -28,7 +28,7 @@ EXPORT_SYMBOL(qdf2400_e44_present); | |||
28 | 28 | ||
29 | /* | 29 | /* |
30 | * Some Qualcomm Datacenter Technologies SoCs have a defective UART BUSY bit. | 30 | * Some Qualcomm Datacenter Technologies SoCs have a defective UART BUSY bit. |
31 | * Detect them by examining the OEM fields in the SPCR header, similiar to PCI | 31 | * Detect them by examining the OEM fields in the SPCR header, similar to PCI |
32 | * quirk detection in pci_mcfg.c. | 32 | * quirk detection in pci_mcfg.c. |
33 | */ | 33 | */ |
34 | static bool qdf2400_erratum_44_present(struct acpi_table_header *h) | 34 | static bool qdf2400_erratum_44_present(struct acpi_table_header *h) |
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index fa76f5e41b5c..75948a3f1a20 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c | |||
@@ -327,9 +327,9 @@ static struct kobject *hotplug_kobj; | |||
327 | 327 | ||
328 | struct acpi_table_attr { | 328 | struct acpi_table_attr { |
329 | struct bin_attribute attr; | 329 | struct bin_attribute attr; |
330 | char name[ACPI_NAME_SIZE]; | 330 | char name[ACPI_NAMESEG_SIZE]; |
331 | int instance; | 331 | int instance; |
332 | char filename[ACPI_NAME_SIZE+ACPI_INST_SIZE]; | 332 | char filename[ACPI_NAMESEG_SIZE+ACPI_INST_SIZE]; |
333 | struct list_head node; | 333 | struct list_head node; |
334 | }; | 334 | }; |
335 | 335 | ||
@@ -368,10 +368,10 @@ static int acpi_table_attr_init(struct kobject *tables_obj, | |||
368 | char instance_str[ACPI_INST_SIZE]; | 368 | char instance_str[ACPI_INST_SIZE]; |
369 | 369 | ||
370 | sysfs_attr_init(&table_attr->attr.attr); | 370 | sysfs_attr_init(&table_attr->attr.attr); |
371 | ACPI_MOVE_NAME(table_attr->name, table_header->signature); | 371 | ACPI_COPY_NAMESEG(table_attr->name, table_header->signature); |
372 | 372 | ||
373 | list_for_each_entry(attr, &acpi_table_attr_list, node) { | 373 | list_for_each_entry(attr, &acpi_table_attr_list, node) { |
374 | if (ACPI_COMPARE_NAME(table_attr->name, attr->name)) | 374 | if (ACPI_COMPARE_NAMESEG(table_attr->name, attr->name)) |
375 | if (table_attr->instance < attr->instance) | 375 | if (table_attr->instance < attr->instance) |
376 | table_attr->instance = attr->instance; | 376 | table_attr->instance = attr->instance; |
377 | } | 377 | } |
@@ -382,8 +382,8 @@ static int acpi_table_attr_init(struct kobject *tables_obj, | |||
382 | return -ERANGE; | 382 | return -ERANGE; |
383 | } | 383 | } |
384 | 384 | ||
385 | ACPI_MOVE_NAME(table_attr->filename, table_header->signature); | 385 | ACPI_COPY_NAMESEG(table_attr->filename, table_header->signature); |
386 | table_attr->filename[ACPI_NAME_SIZE] = '\0'; | 386 | table_attr->filename[ACPI_NAMESEG_SIZE] = '\0'; |
387 | if (table_attr->instance > 1 || (table_attr->instance == 1 && | 387 | if (table_attr->instance > 1 || (table_attr->instance == 1 && |
388 | !acpi_get_table | 388 | !acpi_get_table |
389 | (table_header->signature, 2, &header))) { | 389 | (table_header->signature, 2, &header))) { |
@@ -484,7 +484,7 @@ static int acpi_table_data_init(struct acpi_table_header *th) | |||
484 | int i; | 484 | int i; |
485 | 485 | ||
486 | for (i = 0; i < NUM_ACPI_DATA_OBJS; i++) { | 486 | for (i = 0; i < NUM_ACPI_DATA_OBJS; i++) { |
487 | if (ACPI_COMPARE_NAME(th->signature, acpi_data_objs[i].name)) { | 487 | if (ACPI_COMPARE_NAMESEG(th->signature, acpi_data_objs[i].name)) { |
488 | data_attr = kzalloc(sizeof(*data_attr), GFP_KERNEL); | 488 | data_attr = kzalloc(sizeof(*data_attr), GFP_KERNEL); |
489 | if (!data_attr) | 489 | if (!data_attr) |
490 | return -ENOMEM; | 490 | return -ENOMEM; |
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index 8fccbe49612a..d7bf936b1646 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c | |||
@@ -240,8 +240,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) | |||
240 | * On success returns sum of all matching entries for all proc handlers. | 240 | * On success returns sum of all matching entries for all proc handlers. |
241 | * Otherwise, -ENODEV or -EINVAL is returned. | 241 | * Otherwise, -ENODEV or -EINVAL is returned. |
242 | */ | 242 | */ |
243 | static int __init | 243 | static int __init acpi_parse_entries_array(char *id, unsigned long table_size, |
244 | acpi_parse_entries_array(char *id, unsigned long table_size, | ||
245 | struct acpi_table_header *table_header, | 244 | struct acpi_table_header *table_header, |
246 | struct acpi_subtable_proc *proc, int proc_num, | 245 | struct acpi_subtable_proc *proc, int proc_num, |
247 | unsigned int max_entries) | 246 | unsigned int max_entries) |
@@ -314,8 +313,7 @@ acpi_parse_entries_array(char *id, unsigned long table_size, | |||
314 | return errs ? -EINVAL : count; | 313 | return errs ? -EINVAL : count; |
315 | } | 314 | } |
316 | 315 | ||
317 | int __init | 316 | int __init acpi_table_parse_entries_array(char *id, |
318 | acpi_table_parse_entries_array(char *id, | ||
319 | unsigned long table_size, | 317 | unsigned long table_size, |
320 | struct acpi_subtable_proc *proc, int proc_num, | 318 | struct acpi_subtable_proc *proc, int proc_num, |
321 | unsigned int max_entries) | 319 | unsigned int max_entries) |
@@ -346,8 +344,7 @@ acpi_table_parse_entries_array(char *id, | |||
346 | return count; | 344 | return count; |
347 | } | 345 | } |
348 | 346 | ||
349 | int __init | 347 | int __init acpi_table_parse_entries(char *id, |
350 | acpi_table_parse_entries(char *id, | ||
351 | unsigned long table_size, | 348 | unsigned long table_size, |
352 | int entry_id, | 349 | int entry_id, |
353 | acpi_tbl_entry_handler handler, | 350 | acpi_tbl_entry_handler handler, |
@@ -362,8 +359,7 @@ acpi_table_parse_entries(char *id, | |||
362 | max_entries); | 359 | max_entries); |
363 | } | 360 | } |
364 | 361 | ||
365 | int __init | 362 | int __init acpi_table_parse_madt(enum acpi_madt_type id, |
366 | acpi_table_parse_madt(enum acpi_madt_type id, | ||
367 | acpi_tbl_entry_handler handler, unsigned int max_entries) | 363 | acpi_tbl_entry_handler handler, unsigned int max_entries) |
368 | { | 364 | { |
369 | return acpi_table_parse_entries(ACPI_SIG_MADT, | 365 | return acpi_table_parse_entries(ACPI_SIG_MADT, |
@@ -670,8 +666,8 @@ static void __init acpi_table_initrd_scan(void) | |||
670 | table_length = table->length; | 666 | table_length = table->length; |
671 | 667 | ||
672 | /* Skip RSDT/XSDT which should only be used for override */ | 668 | /* Skip RSDT/XSDT which should only be used for override */ |
673 | if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_RSDT) || | 669 | if (ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_RSDT) || |
674 | ACPI_COMPARE_NAME(table->signature, ACPI_SIG_XSDT)) { | 670 | ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_XSDT)) { |
675 | acpi_os_unmap_memory(table, ACPI_HEADER_SIZE); | 671 | acpi_os_unmap_memory(table, ACPI_HEADER_SIZE); |
676 | goto next_table; | 672 | goto next_table; |
677 | } | 673 | } |
@@ -725,8 +721,7 @@ static void *amlcode __attribute__ ((weakref("AmlCode"))); | |||
725 | static void *dsdt_amlcode __attribute__ ((weakref("dsdt_aml_code"))); | 721 | static void *dsdt_amlcode __attribute__ ((weakref("dsdt_aml_code"))); |
726 | #endif | 722 | #endif |
727 | 723 | ||
728 | acpi_status | 724 | acpi_status acpi_os_table_override(struct acpi_table_header *existing_table, |
729 | acpi_os_table_override(struct acpi_table_header *existing_table, | ||
730 | struct acpi_table_header **new_table) | 725 | struct acpi_table_header **new_table) |
731 | { | 726 | { |
732 | if (!existing_table || !new_table) | 727 | if (!existing_table || !new_table) |
@@ -788,7 +783,6 @@ static int __init acpi_parse_apic_instance(char *str) | |||
788 | 783 | ||
789 | return 0; | 784 | return 0; |
790 | } | 785 | } |
791 | |||
792 | early_param("acpi_apic_instance", acpi_parse_apic_instance); | 786 | early_param("acpi_apic_instance", acpi_parse_apic_instance); |
793 | 787 | ||
794 | static int __init acpi_force_table_verification_setup(char *s) | 788 | static int __init acpi_force_table_verification_setup(char *s) |
@@ -797,7 +791,6 @@ static int __init acpi_force_table_verification_setup(char *s) | |||
797 | 791 | ||
798 | return 0; | 792 | return 0; |
799 | } | 793 | } |
800 | |||
801 | early_param("acpi_force_table_verification", acpi_force_table_verification_setup); | 794 | early_param("acpi_force_table_verification", acpi_force_table_verification_setup); |
802 | 795 | ||
803 | static int __init acpi_force_32bit_fadt_addr(char *s) | 796 | static int __init acpi_force_32bit_fadt_addr(char *s) |
@@ -807,5 +800,4 @@ static int __init acpi_force_32bit_fadt_addr(char *s) | |||
807 | 800 | ||
808 | return 0; | 801 | return 0; |
809 | } | 802 | } |
810 | |||
811 | early_param("acpi_force_32bit_fadt_addr", acpi_force_32bit_fadt_addr); | 803 | early_param("acpi_force_32bit_fadt_addr", acpi_force_32bit_fadt_addr); |
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index c4b06cc075f9..89363b245489 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c | |||
@@ -739,6 +739,7 @@ EXPORT_SYMBOL(acpi_dev_found); | |||
739 | 739 | ||
740 | struct acpi_dev_match_info { | 740 | struct acpi_dev_match_info { |
741 | const char *dev_name; | 741 | const char *dev_name; |
742 | struct acpi_device *adev; | ||
742 | struct acpi_device_id hid[2]; | 743 | struct acpi_device_id hid[2]; |
743 | const char *uid; | 744 | const char *uid; |
744 | s64 hrv; | 745 | s64 hrv; |
@@ -759,6 +760,7 @@ static int acpi_dev_match_cb(struct device *dev, void *data) | |||
759 | return 0; | 760 | return 0; |
760 | 761 | ||
761 | match->dev_name = acpi_dev_name(adev); | 762 | match->dev_name = acpi_dev_name(adev); |
763 | match->adev = adev; | ||
762 | 764 | ||
763 | if (match->hrv == -1) | 765 | if (match->hrv == -1) |
764 | return 1; | 766 | return 1; |
@@ -806,18 +808,20 @@ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) | |||
806 | EXPORT_SYMBOL(acpi_dev_present); | 808 | EXPORT_SYMBOL(acpi_dev_present); |
807 | 809 | ||
808 | /** | 810 | /** |
809 | * acpi_dev_get_first_match_name - Return name of first match of ACPI device | 811 | * acpi_dev_get_first_match_dev - Return the first match of ACPI device |
810 | * @hid: Hardware ID of the device. | 812 | * @hid: Hardware ID of the device. |
811 | * @uid: Unique ID of the device, pass NULL to not check _UID | 813 | * @uid: Unique ID of the device, pass NULL to not check _UID |
812 | * @hrv: Hardware Revision of the device, pass -1 to not check _HRV | 814 | * @hrv: Hardware Revision of the device, pass -1 to not check _HRV |
813 | * | 815 | * |
814 | * Return device name if a matching device was present | 816 | * Return the first match of ACPI device if a matching device was present |
815 | * at the moment of invocation, or NULL otherwise. | 817 | * at the moment of invocation, or NULL otherwise. |
816 | * | 818 | * |
819 | * The caller is responsible to call put_device() on the returned device. | ||
820 | * | ||
817 | * See additional information in acpi_dev_present() as well. | 821 | * See additional information in acpi_dev_present() as well. |
818 | */ | 822 | */ |
819 | const char * | 823 | struct acpi_device * |
820 | acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv) | 824 | acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv) |
821 | { | 825 | { |
822 | struct acpi_dev_match_info match = {}; | 826 | struct acpi_dev_match_info match = {}; |
823 | struct device *dev; | 827 | struct device *dev; |
@@ -827,9 +831,9 @@ acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv) | |||
827 | match.hrv = hrv; | 831 | match.hrv = hrv; |
828 | 832 | ||
829 | dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb); | 833 | dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb); |
830 | return dev ? match.dev_name : NULL; | 834 | return dev ? match.adev : NULL; |
831 | } | 835 | } |
832 | EXPORT_SYMBOL(acpi_dev_get_first_match_name); | 836 | EXPORT_SYMBOL(acpi_dev_get_first_match_dev); |
833 | 837 | ||
834 | /* | 838 | /* |
835 | * acpi_backlight= handling, this is done here rather then in video_detect.c | 839 | * acpi_backlight= handling, this is done here rather then in video_detect.c |
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 43587ac680e4..31014c7d3793 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c | |||
@@ -112,7 +112,7 @@ static int video_detect_force_none(const struct dmi_system_id *d) | |||
112 | static const struct dmi_system_id video_detect_dmi_table[] = { | 112 | static const struct dmi_system_id video_detect_dmi_table[] = { |
113 | /* On Samsung X360, the BIOS will set a flag (VDRV) if generic | 113 | /* On Samsung X360, the BIOS will set a flag (VDRV) if generic |
114 | * ACPI backlight device is used. This flag will definitively break | 114 | * ACPI backlight device is used. This flag will definitively break |
115 | * the backlight interface (even the vendor interface) untill next | 115 | * the backlight interface (even the vendor interface) until next |
116 | * reboot. It's why we should prevent video.ko from being used here | 116 | * reboot. It's why we should prevent video.ko from being used here |
117 | * and we can't rely on a later call to acpi_video_unregister(). | 117 | * and we can't rely on a later call to acpi_video_unregister(). |
118 | */ | 118 | */ |
@@ -141,6 +141,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = { | |||
141 | DMI_MATCH(DMI_PRODUCT_NAME, "UL30A"), | 141 | DMI_MATCH(DMI_PRODUCT_NAME, "UL30A"), |
142 | }, | 142 | }, |
143 | }, | 143 | }, |
144 | { | ||
145 | .callback = video_detect_force_vendor, | ||
146 | .ident = "Sony VPCEH3U1E", | ||
147 | .matches = { | ||
148 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
149 | DMI_MATCH(DMI_PRODUCT_NAME, "VPCEH3U1E"), | ||
150 | }, | ||
151 | }, | ||
144 | 152 | ||
145 | /* | 153 | /* |
146 | * These models have a working acpi_video backlight control, and using | 154 | * These models have a working acpi_video backlight control, and using |
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c index a983708b77a6..50f9402fb325 100644 --- a/drivers/extcon/extcon-axp288.c +++ b/drivers/extcon/extcon-axp288.c | |||
@@ -333,7 +333,7 @@ static int axp288_extcon_probe(struct platform_device *pdev) | |||
333 | struct axp288_extcon_info *info; | 333 | struct axp288_extcon_info *info; |
334 | struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); | 334 | struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); |
335 | struct device *dev = &pdev->dev; | 335 | struct device *dev = &pdev->dev; |
336 | const char *name; | 336 | struct acpi_device *adev; |
337 | int ret, i, pirq; | 337 | int ret, i, pirq; |
338 | 338 | ||
339 | info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); | 339 | info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); |
@@ -357,9 +357,10 @@ static int axp288_extcon_probe(struct platform_device *pdev) | |||
357 | if (ret) | 357 | if (ret) |
358 | return ret; | 358 | return ret; |
359 | 359 | ||
360 | name = acpi_dev_get_first_match_name("INT3496", NULL, -1); | 360 | adev = acpi_dev_get_first_match_dev("INT3496", NULL, -1); |
361 | if (name) { | 361 | if (adev) { |
362 | info->id_extcon = extcon_get_extcon_dev(name); | 362 | info->id_extcon = extcon_get_extcon_dev(acpi_dev_name(adev)); |
363 | put_device(&adev->dev); | ||
363 | if (!info->id_extcon) | 364 | if (!info->id_extcon) |
364 | return -EPROBE_DEFER; | 365 | return -EPROBE_DEFER; |
365 | 366 | ||
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c index c51462f5aa1e..a5dc0629f225 100644 --- a/drivers/firmware/iscsi_ibft.c +++ b/drivers/firmware/iscsi_ibft.c | |||
@@ -425,7 +425,7 @@ static ssize_t ibft_attr_show_acpitbl(void *data, int type, char *buf) | |||
425 | 425 | ||
426 | switch (type) { | 426 | switch (type) { |
427 | case ISCSI_BOOT_ACPITBL_SIGNATURE: | 427 | case ISCSI_BOOT_ACPITBL_SIGNATURE: |
428 | str += sprintf_string(str, ACPI_NAME_SIZE, | 428 | str += sprintf_string(str, ACPI_NAMESEG_SIZE, |
429 | entry->header->header.signature); | 429 | entry->header->header.signature); |
430 | break; | 430 | break; |
431 | case ISCSI_BOOT_ACPITBL_OEM_ID: | 431 | case ISCSI_BOOT_ACPITBL_OEM_ID: |
diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c index 7c659fdaa6d5..3302125e5265 100644 --- a/drivers/gpio/gpio-merrifield.c +++ b/drivers/gpio/gpio-merrifield.c | |||
@@ -377,10 +377,20 @@ static void mrfld_irq_init_hw(struct mrfld_gpio *priv) | |||
377 | } | 377 | } |
378 | } | 378 | } |
379 | 379 | ||
380 | static const char *mrfld_gpio_get_pinctrl_dev_name(void) | 380 | static const char *mrfld_gpio_get_pinctrl_dev_name(struct mrfld_gpio *priv) |
381 | { | 381 | { |
382 | const char *dev_name = acpi_dev_get_first_match_name("INTC1002", NULL, -1); | 382 | struct acpi_device *adev; |
383 | return dev_name ? dev_name : "pinctrl-merrifield"; | 383 | const char *name; |
384 | |||
385 | adev = acpi_dev_get_first_match_dev("INTC1002", NULL, -1); | ||
386 | if (adev) { | ||
387 | name = devm_kstrdup(priv->dev, acpi_dev_name(adev), GFP_KERNEL); | ||
388 | acpi_dev_put(adev); | ||
389 | } else { | ||
390 | name = "pinctrl-merrifield"; | ||
391 | } | ||
392 | |||
393 | return name; | ||
384 | } | 394 | } |
385 | 395 | ||
386 | static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id) | 396 | static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
@@ -441,7 +451,7 @@ static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id | |||
441 | return retval; | 451 | return retval; |
442 | } | 452 | } |
443 | 453 | ||
444 | pinctrl_dev_name = mrfld_gpio_get_pinctrl_dev_name(); | 454 | pinctrl_dev_name = mrfld_gpio_get_pinctrl_dev_name(priv); |
445 | for (i = 0; i < ARRAY_SIZE(mrfld_gpio_ranges); i++) { | 455 | for (i = 0; i < ARRAY_SIZE(mrfld_gpio_ranges); i++) { |
446 | range = &mrfld_gpio_ranges[i]; | 456 | range = &mrfld_gpio_ranges[i]; |
447 | retval = gpiochip_add_pin_range(&priv->chip, | 457 | retval = gpiochip_add_pin_range(&priv->chip, |
diff --git a/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c b/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c index 45e7e5cbdffb..7c71ffb733a1 100644 --- a/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c +++ b/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c | |||
@@ -230,7 +230,7 @@ static void get_single_name(acpi_handle handle, char *name) | |||
230 | if (ACPI_FAILURE(acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer))) | 230 | if (ACPI_FAILURE(acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer))) |
231 | pr_warn("Failed to get device name from acpi handle\n"); | 231 | pr_warn("Failed to get device name from acpi handle\n"); |
232 | else { | 232 | else { |
233 | memcpy(name, buffer.pointer, ACPI_NAME_SIZE); | 233 | memcpy(name, buffer.pointer, ACPI_NAMESEG_SIZE); |
234 | kfree(buffer.pointer); | 234 | kfree(buffer.pointer); |
235 | } | 235 | } |
236 | } | 236 | } |