aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/ec.c6
-rw-r--r--drivers/acpi/executer/exregion.c5
-rw-r--r--drivers/acpi/fan.c30
-rw-r--r--drivers/acpi/processor_core.c39
-rw-r--r--drivers/acpi/processor_idle.c10
-rw-r--r--drivers/acpi/utils.c18
-rw-r--r--drivers/acpi/video.c3
7 files changed, 67 insertions, 44 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 7222a18a0319..caf873c14bfb 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -943,7 +943,11 @@ int __init acpi_ec_ecdt_probe(void)
943 boot_ec->command_addr = ecdt_ptr->control.address; 943 boot_ec->command_addr = ecdt_ptr->control.address;
944 boot_ec->data_addr = ecdt_ptr->data.address; 944 boot_ec->data_addr = ecdt_ptr->data.address;
945 boot_ec->gpe = ecdt_ptr->gpe; 945 boot_ec->gpe = ecdt_ptr->gpe;
946 boot_ec->handle = ACPI_ROOT_OBJECT; 946 if (ACPI_FAILURE(acpi_get_handle(NULL, ecdt_ptr->id,
947 &boot_ec->handle))) {
948 pr_info("Failed to locate handle for boot EC\n");
949 boot_ec->handle = ACPI_ROOT_OBJECT;
950 }
947 } else { 951 } else {
948 /* This workaround is needed only on some broken machines, 952 /* This workaround is needed only on some broken machines,
949 * which require early EC, but fail to provide ECDT */ 953 * which require early EC, but fail to provide ECDT */
diff --git a/drivers/acpi/executer/exregion.c b/drivers/acpi/executer/exregion.c
index 2e9ce94798c7..3f51b7e84a17 100644
--- a/drivers/acpi/executer/exregion.c
+++ b/drivers/acpi/executer/exregion.c
@@ -338,6 +338,7 @@ acpi_ex_pci_config_space_handler(u32 function,
338 acpi_status status = AE_OK; 338 acpi_status status = AE_OK;
339 struct acpi_pci_id *pci_id; 339 struct acpi_pci_id *pci_id;
340 u16 pci_register; 340 u16 pci_register;
341 u32 value32;
341 342
342 ACPI_FUNCTION_TRACE(ex_pci_config_space_handler); 343 ACPI_FUNCTION_TRACE(ex_pci_config_space_handler);
343 344
@@ -364,9 +365,9 @@ acpi_ex_pci_config_space_handler(u32 function,
364 switch (function) { 365 switch (function) {
365 case ACPI_READ: 366 case ACPI_READ:
366 367
367 *value = 0;
368 status = acpi_os_read_pci_configuration(pci_id, pci_register, 368 status = acpi_os_read_pci_configuration(pci_id, pci_register,
369 value, bit_width); 369 &value32, bit_width);
370 *value = value32;
370 break; 371 break;
371 372
372 case ACPI_WRITE: 373 case ACPI_WRITE:
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index 48cb705b274a..c8e3cba423ef 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -256,22 +256,28 @@ static int acpi_fan_add(struct acpi_device *device)
256 256
257 cdev = thermal_cooling_device_register("Fan", device, 257 cdev = thermal_cooling_device_register("Fan", device,
258 &fan_cooling_ops); 258 &fan_cooling_ops);
259 if (cdev) 259 if (IS_ERR(cdev)) {
260 result = PTR_ERR(cdev);
261 goto end;
262 }
263 if (cdev) {
260 printk(KERN_INFO PREFIX 264 printk(KERN_INFO PREFIX
261 "%s is registered as cooling_device%d\n", 265 "%s is registered as cooling_device%d\n",
262 device->dev.bus_id, cdev->id); 266 device->dev.bus_id, cdev->id);
263 else
264 goto end;
265 acpi_driver_data(device) = cdev;
266 result = sysfs_create_link(&device->dev.kobj, &cdev->device.kobj,
267 "thermal_cooling");
268 if (result)
269 return result;
270 267
271 result = sysfs_create_link(&cdev->device.kobj, &device->dev.kobj, 268 acpi_driver_data(device) = cdev;
272 "device"); 269 result = sysfs_create_link(&device->dev.kobj,
273 if (result) 270 &cdev->device.kobj,
274 return result; 271 "thermal_cooling");
272 if (result)
273 return result;
274
275 result = sysfs_create_link(&cdev->device.kobj,
276 &device->dev.kobj,
277 "device");
278 if (result)
279 return result;
280 }
275 281
276 result = acpi_fan_add_fs(device); 282 result = acpi_fan_add_fs(device);
277 if (result) 283 if (result)
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 75ccf5d18bf4..a3cc8a98255c 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -670,21 +670,26 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
670 670
671 pr->cdev = thermal_cooling_device_register("Processor", device, 671 pr->cdev = thermal_cooling_device_register("Processor", device,
672 &processor_cooling_ops); 672 &processor_cooling_ops);
673 if (pr->cdev) 673 if (IS_ERR(pr->cdev)) {
674 result = PTR_ERR(pr->cdev);
675 goto end;
676 }
677 if (pr->cdev) {
674 printk(KERN_INFO PREFIX 678 printk(KERN_INFO PREFIX
675 "%s is registered as cooling_device%d\n", 679 "%s is registered as cooling_device%d\n",
676 device->dev.bus_id, pr->cdev->id); 680 device->dev.bus_id, pr->cdev->id);
677 else
678 goto end;
679 681
680 result = sysfs_create_link(&device->dev.kobj, &pr->cdev->device.kobj, 682 result = sysfs_create_link(&device->dev.kobj,
681 "thermal_cooling"); 683 &pr->cdev->device.kobj,
682 if (result) 684 "thermal_cooling");
683 return result; 685 if (result)
684 result = sysfs_create_link(&pr->cdev->device.kobj, &device->dev.kobj, 686 return result;
685 "device"); 687 result = sysfs_create_link(&pr->cdev->device.kobj,
686 if (result) 688 &device->dev.kobj,
687 return result; 689 "device");
690 if (result)
691 return result;
692 }
688 693
689 if (pr->flags.throttling) { 694 if (pr->flags.throttling) {
690 printk(KERN_INFO PREFIX "%s [%s] (supports", 695 printk(KERN_INFO PREFIX "%s [%s] (supports",
@@ -809,10 +814,12 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
809 814
810 acpi_processor_remove_fs(device); 815 acpi_processor_remove_fs(device);
811 816
812 sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); 817 if (pr->cdev) {
813 sysfs_remove_link(&pr->cdev->device.kobj, "device"); 818 sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
814 thermal_cooling_device_unregister(pr->cdev); 819 sysfs_remove_link(&pr->cdev->device.kobj, "device");
815 pr->cdev = NULL; 820 thermal_cooling_device_unregister(pr->cdev);
821 pr->cdev = NULL;
822 }
816 823
817 processors[pr->id] = NULL; 824 processors[pr->id] = NULL;
818 825
@@ -826,8 +833,6 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
826 * Acpi processor hotplug support * 833 * Acpi processor hotplug support *
827 ****************************************************************************/ 834 ****************************************************************************/
828 835
829static int is_processor_present(acpi_handle handle);
830
831static int is_processor_present(acpi_handle handle) 836static int is_processor_present(acpi_handle handle)
832{ 837{
833 acpi_status status; 838 acpi_status status;
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 980e1c33e6c5..6f3b217699e9 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -364,7 +364,7 @@ int acpi_processor_resume(struct acpi_device * device)
364 return 0; 364 return 0;
365} 365}
366 366
367#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC) 367#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
368static int tsc_halts_in_c(int state) 368static int tsc_halts_in_c(int state)
369{ 369{
370 switch (boot_cpu_data.x86_vendor) { 370 switch (boot_cpu_data.x86_vendor) {
@@ -544,7 +544,7 @@ static void acpi_processor_idle(void)
544 /* Get end time (ticks) */ 544 /* Get end time (ticks) */
545 t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); 545 t2 = inl(acpi_gbl_FADT.xpm_timer_block.address);
546 546
547#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC) 547#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
548 /* TSC halts in C2, so notify users */ 548 /* TSC halts in C2, so notify users */
549 if (tsc_halts_in_c(ACPI_STATE_C2)) 549 if (tsc_halts_in_c(ACPI_STATE_C2))
550 mark_tsc_unstable("possible TSC halt in C2"); 550 mark_tsc_unstable("possible TSC halt in C2");
@@ -609,7 +609,7 @@ static void acpi_processor_idle(void)
609 acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0); 609 acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0);
610 } 610 }
611 611
612#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC) 612#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
613 /* TSC halts in C3, so notify users */ 613 /* TSC halts in C3, so notify users */
614 if (tsc_halts_in_c(ACPI_STATE_C3)) 614 if (tsc_halts_in_c(ACPI_STATE_C3))
615 mark_tsc_unstable("TSC halts in C3"); 615 mark_tsc_unstable("TSC halts in C3");
@@ -1500,7 +1500,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
1500 acpi_idle_do_entry(cx); 1500 acpi_idle_do_entry(cx);
1501 t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); 1501 t2 = inl(acpi_gbl_FADT.xpm_timer_block.address);
1502 1502
1503#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC) 1503#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
1504 /* TSC could halt in idle, so notify users */ 1504 /* TSC could halt in idle, so notify users */
1505 if (tsc_halts_in_c(cx->type)) 1505 if (tsc_halts_in_c(cx->type))
1506 mark_tsc_unstable("TSC halts in idle");; 1506 mark_tsc_unstable("TSC halts in idle");;
@@ -1614,7 +1614,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
1614 spin_unlock(&c3_lock); 1614 spin_unlock(&c3_lock);
1615 } 1615 }
1616 1616
1617#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC) 1617#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
1618 /* TSC could halt in idle, so notify users */ 1618 /* TSC could halt in idle, so notify users */
1619 if (tsc_halts_in_c(ACPI_STATE_C3)) 1619 if (tsc_halts_in_c(ACPI_STATE_C3))
1620 mark_tsc_unstable("TSC halts in idle"); 1620 mark_tsc_unstable("TSC halts in idle");
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index 34f157571080..eba55b7d6c95 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -36,16 +36,20 @@ ACPI_MODULE_NAME("utils");
36/* -------------------------------------------------------------------------- 36/* --------------------------------------------------------------------------
37 Object Evaluation Helpers 37 Object Evaluation Helpers
38 -------------------------------------------------------------------------- */ 38 -------------------------------------------------------------------------- */
39static void
40acpi_util_eval_error(acpi_handle h, acpi_string p, acpi_status s)
41{
39#ifdef ACPI_DEBUG_OUTPUT 42#ifdef ACPI_DEBUG_OUTPUT
40#define acpi_util_eval_error(h,p,s) {\ 43 char prefix[80] = {'\0'};
41 char prefix[80] = {'\0'};\ 44 struct acpi_buffer buffer = {sizeof(prefix), prefix};
42 struct acpi_buffer buffer = {sizeof(prefix), prefix};\ 45 acpi_get_name(h, ACPI_FULL_PATHNAME, &buffer);
43 acpi_get_name(h, ACPI_FULL_PATHNAME, &buffer);\ 46 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluate [%s.%s]: %s\n",
44 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluate [%s.%s]: %s\n",\ 47 (char *) prefix, p, acpi_format_exception(s)));
45 (char *) prefix, p, acpi_format_exception(s))); }
46#else 48#else
47#define acpi_util_eval_error(h,p,s) 49 return;
48#endif 50#endif
51}
52
49acpi_status 53acpi_status
50acpi_extract_package(union acpi_object *package, 54acpi_extract_package(union acpi_object *package,
51 struct acpi_buffer *format, struct acpi_buffer *buffer) 55 struct acpi_buffer *format, struct acpi_buffer *buffer)
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 7f714fa2a454..12cce69b5441 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -731,6 +731,9 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
731 731
732 device->cdev = thermal_cooling_device_register("LCD", 732 device->cdev = thermal_cooling_device_register("LCD",
733 device->dev, &video_cooling_ops); 733 device->dev, &video_cooling_ops);
734 if (IS_ERR(device->cdev))
735 return;
736
734 if (device->cdev) { 737 if (device->cdev) {
735 printk(KERN_INFO PREFIX 738 printk(KERN_INFO PREFIX
736 "%s is registered as cooling_device%d\n", 739 "%s is registered as cooling_device%d\n",