aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorToshi Kani <toshi.kani@hp.com>2012-11-20 18:42:30 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-11-21 17:20:23 -0500
commitcd73018f628e5016792575e54401ad6faab3a901 (patch)
tree59d8e3dc8ece3391abbadc42bd3ef304aee8063c /drivers/acpi
parent3d78bd9ef746d6468b1dbb2518b1287092b997b5 (diff)
ACPI: Update Dock hotplug error messages
Updated Dock hotplug error messages with acpi_handle_<level>() and pr_<level>(). Replaced acpi_get_name() & kfree() with apci_handle_<level>(). Added error status to the messages where needed. Signed-off-by: Toshi Kani <toshi.kani@hp.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/dock.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index ae4ebf2d4cd2..f32bd47b35e0 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -31,6 +31,7 @@
31#include <linux/platform_device.h> 31#include <linux/platform_device.h>
32#include <linux/jiffies.h> 32#include <linux/jiffies.h>
33#include <linux/stddef.h> 33#include <linux/stddef.h>
34#include <linux/acpi.h>
34#include <acpi/acpi_bus.h> 35#include <acpi/acpi_bus.h>
35#include <acpi/acpi_drivers.h> 36#include <acpi/acpi_drivers.h>
36 37
@@ -460,12 +461,8 @@ static void handle_dock(struct dock_station *ds, int dock)
460 struct acpi_object_list arg_list; 461 struct acpi_object_list arg_list;
461 union acpi_object arg; 462 union acpi_object arg;
462 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 463 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
463 struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
464 464
465 acpi_get_name(ds->handle, ACPI_FULL_PATHNAME, &name_buffer); 465 acpi_handle_info(ds->handle, "%s\n", dock ? "docking" : "undocking");
466
467 printk(KERN_INFO PREFIX "%s - %s\n",
468 (char *)name_buffer.pointer, dock ? "docking" : "undocking");
469 466
470 /* _DCK method has one argument */ 467 /* _DCK method has one argument */
471 arg_list.count = 1; 468 arg_list.count = 1;
@@ -474,11 +471,10 @@ static void handle_dock(struct dock_station *ds, int dock)
474 arg.integer.value = dock; 471 arg.integer.value = dock;
475 status = acpi_evaluate_object(ds->handle, "_DCK", &arg_list, &buffer); 472 status = acpi_evaluate_object(ds->handle, "_DCK", &arg_list, &buffer);
476 if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) 473 if (ACPI_FAILURE(status) && status != AE_NOT_FOUND)
477 ACPI_EXCEPTION((AE_INFO, status, "%s - failed to execute" 474 acpi_handle_err(ds->handle, "Failed to execute _DCK (0x%x)\n",
478 " _DCK\n", (char *)name_buffer.pointer)); 475 status);
479 476
480 kfree(buffer.pointer); 477 kfree(buffer.pointer);
481 kfree(name_buffer.pointer);
482} 478}
483 479
484static inline void dock(struct dock_station *ds) 480static inline void dock(struct dock_station *ds)
@@ -525,9 +521,11 @@ static void dock_lock(struct dock_station *ds, int lock)
525 status = acpi_evaluate_object(ds->handle, "_LCK", &arg_list, NULL); 521 status = acpi_evaluate_object(ds->handle, "_LCK", &arg_list, NULL);
526 if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { 522 if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
527 if (lock) 523 if (lock)
528 printk(KERN_WARNING PREFIX "Locking device failed\n"); 524 acpi_handle_warn(ds->handle,
525 "Locking device failed (0x%x)\n", status);
529 else 526 else
530 printk(KERN_WARNING PREFIX "Unlocking device failed\n"); 527 acpi_handle_warn(ds->handle,
528 "Unlocking device failed (0x%x)\n", status);
531 } 529 }
532} 530}
533 531
@@ -667,7 +665,7 @@ static int handle_eject_request(struct dock_station *ds, u32 event)
667 dock_lock(ds, 0); 665 dock_lock(ds, 0);
668 eject_dock(ds); 666 eject_dock(ds);
669 if (dock_present(ds)) { 667 if (dock_present(ds)) {
670 printk(KERN_ERR PREFIX "Unable to undock!\n"); 668 acpi_handle_err(ds->handle, "Unable to undock!\n");
671 return -EBUSY; 669 return -EBUSY;
672 } 670 }
673 complete_undock(ds); 671 complete_undock(ds);
@@ -715,7 +713,7 @@ static void dock_notify(acpi_handle handle, u32 event, void *data)
715 begin_dock(ds); 713 begin_dock(ds);
716 dock(ds); 714 dock(ds);
717 if (!dock_present(ds)) { 715 if (!dock_present(ds)) {
718 printk(KERN_ERR PREFIX "Unable to dock!\n"); 716 acpi_handle_err(handle, "Unable to dock!\n");
719 complete_dock(ds); 717 complete_dock(ds);
720 break; 718 break;
721 } 719 }
@@ -743,7 +741,7 @@ static void dock_notify(acpi_handle handle, u32 event, void *data)
743 dock_event(ds, event, UNDOCK_EVENT); 741 dock_event(ds, event, UNDOCK_EVENT);
744 break; 742 break;
745 default: 743 default:
746 printk(KERN_ERR PREFIX "Unknown dock event %d\n", event); 744 acpi_handle_err(handle, "Unknown dock event %d\n", event);
747 } 745 }
748} 746}
749 747
@@ -987,7 +985,7 @@ err_rmgroup:
987 sysfs_remove_group(&dd->dev.kobj, &dock_attribute_group); 985 sysfs_remove_group(&dd->dev.kobj, &dock_attribute_group);
988err_unregister: 986err_unregister:
989 platform_device_unregister(dd); 987 platform_device_unregister(dd);
990 printk(KERN_ERR "%s encountered error %d\n", __func__, ret); 988 acpi_handle_err(handle, "%s encountered error %d\n", __func__, ret);
991 return ret; 989 return ret;
992} 990}
993 991
@@ -1043,12 +1041,12 @@ static int __init dock_init(void)
1043 ACPI_UINT32_MAX, find_dock_and_bay, NULL, NULL, NULL); 1041 ACPI_UINT32_MAX, find_dock_and_bay, NULL, NULL, NULL);
1044 1042
1045 if (!dock_station_count) { 1043 if (!dock_station_count) {
1046 printk(KERN_INFO PREFIX "No dock devices found.\n"); 1044 pr_info(PREFIX "No dock devices found.\n");
1047 return 0; 1045 return 0;
1048 } 1046 }
1049 1047
1050 register_acpi_bus_notifier(&dock_acpi_notifier); 1048 register_acpi_bus_notifier(&dock_acpi_notifier);
1051 printk(KERN_INFO PREFIX "%s: %d docks/bays found\n", 1049 pr_info(PREFIX "%s: %d docks/bays found\n",
1052 ACPI_DOCK_DRIVER_DESCRIPTION, dock_station_count); 1050 ACPI_DOCK_DRIVER_DESCRIPTION, dock_station_count);
1053 return 0; 1051 return 0;
1054} 1052}