aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/battery.c
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2006-06-26 23:58:43 -0400
committerLen Brown <len.brown@intel.com>2006-06-26 23:58:43 -0400
commita6fc67202e0224e6c9d1d285cc0b444bce887ed5 (patch)
treecb2d422f65c0ab0a95f452f6bac80e2bfdd547de /drivers/acpi/battery.c
parenteb99adde31b7d85c67a5e1c2fa5e098e1056dd79 (diff)
ACPI: Enable ACPI error messages w/o CONFIG_ACPI_DEBUG
Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/battery.c')
-rw-r--r--drivers/acpi/battery.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 702e857e98c5..3b92c94ebc60 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -141,7 +141,7 @@ acpi_battery_get_info(struct acpi_battery *battery,
141 141
142 status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer); 142 status = acpi_evaluate_object(battery->handle, "_BIF", NULL, &buffer);
143 if (ACPI_FAILURE(status)) { 143 if (ACPI_FAILURE(status)) {
144 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BIF\n")); 144 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF"));
145 return_VALUE(-ENODEV); 145 return_VALUE(-ENODEV);
146 } 146 }
147 147
@@ -151,7 +151,7 @@ acpi_battery_get_info(struct acpi_battery *battery,
151 151
152 status = acpi_extract_package(package, &format, &data); 152 status = acpi_extract_package(package, &format, &data);
153 if (status != AE_BUFFER_OVERFLOW) { 153 if (status != AE_BUFFER_OVERFLOW) {
154 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n")); 154 ACPI_EXCEPTION((AE_INFO, status, "Extracting _BIF"));
155 result = -ENODEV; 155 result = -ENODEV;
156 goto end; 156 goto end;
157 } 157 }
@@ -165,7 +165,7 @@ acpi_battery_get_info(struct acpi_battery *battery,
165 165
166 status = acpi_extract_package(package, &format, &data); 166 status = acpi_extract_package(package, &format, &data);
167 if (ACPI_FAILURE(status)) { 167 if (ACPI_FAILURE(status)) {
168 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BIF\n")); 168 ACPI_EXCEPTION((AE_INFO, status, "Extracting _BIF"));
169 kfree(data.pointer); 169 kfree(data.pointer);
170 result = -ENODEV; 170 result = -ENODEV;
171 goto end; 171 goto end;
@@ -202,7 +202,7 @@ acpi_battery_get_status(struct acpi_battery *battery,
202 202
203 status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer); 203 status = acpi_evaluate_object(battery->handle, "_BST", NULL, &buffer);
204 if (ACPI_FAILURE(status)) { 204 if (ACPI_FAILURE(status)) {
205 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BST\n")); 205 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST"));
206 return_VALUE(-ENODEV); 206 return_VALUE(-ENODEV);
207 } 207 }
208 208
@@ -212,7 +212,7 @@ acpi_battery_get_status(struct acpi_battery *battery,
212 212
213 status = acpi_extract_package(package, &format, &data); 213 status = acpi_extract_package(package, &format, &data);
214 if (status != AE_BUFFER_OVERFLOW) { 214 if (status != AE_BUFFER_OVERFLOW) {
215 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n")); 215 ACPI_EXCEPTION((AE_INFO, status, "Extracting _BST"));
216 result = -ENODEV; 216 result = -ENODEV;
217 goto end; 217 goto end;
218 } 218 }
@@ -226,7 +226,7 @@ acpi_battery_get_status(struct acpi_battery *battery,
226 226
227 status = acpi_extract_package(package, &format, &data); 227 status = acpi_extract_package(package, &format, &data);
228 if (ACPI_FAILURE(status)) { 228 if (ACPI_FAILURE(status)) {
229 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error extracting _BST\n")); 229 ACPI_EXCEPTION((AE_INFO, status, "Extracting _BST"));
230 kfree(data.pointer); 230 kfree(data.pointer);
231 result = -ENODEV; 231 result = -ENODEV;
232 goto end; 232 goto end;
@@ -458,8 +458,6 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset)
458 if ((bst->state & 0x01) && (bst->state & 0x02)) { 458 if ((bst->state & 0x01) && (bst->state & 0x02)) {
459 seq_printf(seq, 459 seq_printf(seq,
460 "charging state: charging/discharging\n"); 460 "charging state: charging/discharging\n");
461 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
462 "Battery Charging and Discharging?\n"));
463 } else if (bst->state & 0x01) 461 } else if (bst->state & 0x01)
464 seq_printf(seq, "charging state: discharging\n"); 462 seq_printf(seq, "charging state: discharging\n");
465 else if (bst->state & 0x02) 463 else if (bst->state & 0x02)
@@ -609,9 +607,7 @@ static int acpi_battery_add_fs(struct acpi_device *device)
609 entry = create_proc_entry(ACPI_BATTERY_FILE_INFO, 607 entry = create_proc_entry(ACPI_BATTERY_FILE_INFO,
610 S_IRUGO, acpi_device_dir(device)); 608 S_IRUGO, acpi_device_dir(device));
611 if (!entry) 609 if (!entry)
612 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 610 return_VALUE(-ENODEV);
613 "Unable to create '%s' fs entry\n",
614 ACPI_BATTERY_FILE_INFO));
615 else { 611 else {
616 entry->proc_fops = &acpi_battery_info_ops; 612 entry->proc_fops = &acpi_battery_info_ops;
617 entry->data = acpi_driver_data(device); 613 entry->data = acpi_driver_data(device);
@@ -622,9 +618,7 @@ static int acpi_battery_add_fs(struct acpi_device *device)
622 entry = create_proc_entry(ACPI_BATTERY_FILE_STATUS, 618 entry = create_proc_entry(ACPI_BATTERY_FILE_STATUS,
623 S_IRUGO, acpi_device_dir(device)); 619 S_IRUGO, acpi_device_dir(device));
624 if (!entry) 620 if (!entry)
625 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 621 return_VALUE(-ENODEV);
626 "Unable to create '%s' fs entry\n",
627 ACPI_BATTERY_FILE_STATUS));
628 else { 622 else {
629 entry->proc_fops = &acpi_battery_state_ops; 623 entry->proc_fops = &acpi_battery_state_ops;
630 entry->data = acpi_driver_data(device); 624 entry->data = acpi_driver_data(device);
@@ -636,9 +630,7 @@ static int acpi_battery_add_fs(struct acpi_device *device)
636 S_IFREG | S_IRUGO | S_IWUSR, 630 S_IFREG | S_IRUGO | S_IWUSR,
637 acpi_device_dir(device)); 631 acpi_device_dir(device));
638 if (!entry) 632 if (!entry)
639 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 633 return_VALUE(-ENODEV);
640 "Unable to create '%s' fs entry\n",
641 ACPI_BATTERY_FILE_ALARM));
642 else { 634 else {
643 entry->proc_fops = &acpi_battery_alarm_ops; 635 entry->proc_fops = &acpi_battery_alarm_ops;
644 entry->data = acpi_driver_data(device); 636 entry->data = acpi_driver_data(device);
@@ -732,8 +724,6 @@ static int acpi_battery_add(struct acpi_device *device)
732 ACPI_DEVICE_NOTIFY, 724 ACPI_DEVICE_NOTIFY,
733 acpi_battery_notify, battery); 725 acpi_battery_notify, battery);
734 if (ACPI_FAILURE(status)) { 726 if (ACPI_FAILURE(status)) {
735 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
736 "Error installing notify handler\n"));
737 result = -ENODEV; 727 result = -ENODEV;
738 goto end; 728 goto end;
739 } 729 }
@@ -766,9 +756,6 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
766 status = acpi_remove_notify_handler(battery->handle, 756 status = acpi_remove_notify_handler(battery->handle,
767 ACPI_DEVICE_NOTIFY, 757 ACPI_DEVICE_NOTIFY,
768 acpi_battery_notify); 758 acpi_battery_notify);
769 if (ACPI_FAILURE(status))
770 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
771 "Error removing notify handler\n"));
772 759
773 acpi_battery_remove_fs(device); 760 acpi_battery_remove_fs(device);
774 761