aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2010-05-16 18:45:54 -0400
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>2010-05-16 18:45:54 -0400
commitef07a5abadfcb2470fc9cbfbee0cb41076b4ba9b (patch)
treedeb4a294d7c750d4942e25618105c22b688493bd /drivers/platform
parent2cbb5c8f5533facb606adc5986ce40da2e987d6d (diff)
thinkpad-acpi: clean up ACPI handles handling
1. Remove <handle>_path, as its only user was already removed in a previous commit 2. Move all handle initialization, as well as <handle>_parent and <handle>_paths to __init.* sections. This reduces the driver's runtime footprint nicely. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 29ad27346443..b3bfce953838 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -516,9 +516,9 @@ static acpi_handle ec_handle;
516 516
517#define TPACPI_HANDLE(object, parent, paths...) \ 517#define TPACPI_HANDLE(object, parent, paths...) \
518 static acpi_handle object##_handle; \ 518 static acpi_handle object##_handle; \
519 static acpi_handle *object##_parent = &parent##_handle; \ 519 static const acpi_handle *object##_parent __initdata = \
520 static char *object##_path; \ 520 &parent##_handle; \
521 static char *object##_paths[] = { paths } 521 static char *object##_paths[] __initdata = { paths }
522 522
523TPACPI_HANDLE(ecrd, ec, "ECRD"); /* 570 */ 523TPACPI_HANDLE(ecrd, ec, "ECRD"); /* 570 */
524TPACPI_HANDLE(ecwr, ec, "ECWR"); /* 570 */ 524TPACPI_HANDLE(ecwr, ec, "ECWR"); /* 570 */
@@ -673,11 +673,11 @@ static int issue_thinkpad_cmos_command(int cmos_cmd)
673 673
674#define TPACPI_ACPIHANDLE_INIT(object) \ 674#define TPACPI_ACPIHANDLE_INIT(object) \
675 drv_acpi_handle_init(#object, &object##_handle, *object##_parent, \ 675 drv_acpi_handle_init(#object, &object##_handle, *object##_parent, \
676 object##_paths, ARRAY_SIZE(object##_paths), &object##_path) 676 object##_paths, ARRAY_SIZE(object##_paths))
677 677
678static void drv_acpi_handle_init(char *name, 678static void __init drv_acpi_handle_init(const char *name,
679 acpi_handle *handle, acpi_handle parent, 679 acpi_handle *handle, const acpi_handle parent,
680 char **paths, int num_paths, char **path) 680 char **paths, const int num_paths)
681{ 681{
682 int i; 682 int i;
683 acpi_status status; 683 acpi_status status;
@@ -688,10 +688,9 @@ static void drv_acpi_handle_init(char *name,
688 for (i = 0; i < num_paths; i++) { 688 for (i = 0; i < num_paths; i++) {
689 status = acpi_get_handle(parent, paths[i], handle); 689 status = acpi_get_handle(parent, paths[i], handle);
690 if (ACPI_SUCCESS(status)) { 690 if (ACPI_SUCCESS(status)) {
691 *path = paths[i];
692 dbg_printk(TPACPI_DBG_INIT, 691 dbg_printk(TPACPI_DBG_INIT,
693 "Found ACPI handle %s for %s\n", 692 "Found ACPI handle %s for %s\n",
694 *path, name); 693 paths[i], name);
695 return; 694 return;
696 } 695 }
697 } 696 }