Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'acpi-messages'

* acpi-messages:
ACPI: OSL: Clean up printing messages
ACPI: OSL: Rework acpi_check_resource_conflict()
ACPI: thermal: Clean up printing messages
ACPI: video: Clean up printing messages
ACPI: button: Clean up printing messages
ACPI: battery: Clean up printing messages
ACPI: AC: Clean up printing messages
ACPI: bus: Drop ACPI_BUS_COMPONENT which is not used any more
ACPI: utils: Clean up printing messages
ACPI: scan: Clean up printing messages
ACPI: bus: Clean up printing messages
ACPI: PM: Clean up printing messages
ACPI: power: Clean up printing messages

+241 -331
+6 -13
Documentation/firmware-guide/acpi/debug.rst
··· 52 52 ACPI_CA_DISASSEMBLER 0x00000800 53 53 ACPI_COMPILER 0x00001000 54 54 ACPI_TOOLS 0x00002000 55 - ACPI_BUS_COMPONENT 0x00010000 56 - ACPI_AC_COMPONENT 0x00020000 57 - ACPI_BATTERY_COMPONENT 0x00040000 58 - ACPI_BUTTON_COMPONENT 0x00080000 59 55 ACPI_SBS_COMPONENT 0x00100000 60 56 ACPI_FAN_COMPONENT 0x00200000 61 57 ACPI_PCI_COMPONENT 0x00400000 62 - ACPI_POWER_COMPONENT 0x00800000 63 58 ACPI_CONTAINER_COMPONENT 0x01000000 64 59 ACPI_SYSTEM_COMPONENT 0x02000000 65 - ACPI_THERMAL_COMPONENT 0x04000000 66 60 ACPI_MEMORY_DEVICE_COMPONENT 0x08000000 67 - ACPI_VIDEO_COMPONENT 0x10000000 68 61 ACPI_PROCESSOR_COMPONENT 0x20000000 69 62 70 63 debug_level ··· 111 118 Examples 112 119 ======== 113 120 114 - For example, drivers/acpi/bus.c contains this:: 121 + For example, drivers/acpi/acpica/evxfevnt.c contains this:: 115 122 116 - #define _COMPONENT ACPI_BUS_COMPONENT 123 + #define _COMPONENT ACPI_EVENTS 117 124 ... 118 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device insertion detected\n")); 125 + ACPI_DEBUG_PRINT((ACPI_DB_INIT, "ACPI mode disabled\n")); 119 126 120 - To turn on this message, set the ACPI_BUS_COMPONENT bit in acpi.debug_layer 121 - and the ACPI_LV_INFO bit in acpi.debug_level. (The ACPI_DEBUG_PRINT 122 - statement uses ACPI_DB_INFO, which is macro based on the ACPI_LV_INFO 127 + To turn on this message, set the ACPI_EVENTS bit in acpi.debug_layer 128 + and the ACPI_LV_INIT bit in acpi.debug_level. (The ACPI_DEBUG_PRINT 129 + statement uses ACPI_DB_INIT, which is a macro based on the ACPI_LV_INIT 123 130 definition.) 124 131 125 132 Enable all AML "Debug" output (stores to the Debug object while interpreting
+10 -13
drivers/acpi/ac.c
··· 6 6 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> 7 7 */ 8 8 9 + #define pr_fmt(fmt) "ACPI: AC: " fmt 10 + 9 11 #include <linux/kernel.h> 10 12 #include <linux/module.h> 11 13 #include <linux/slab.h> ··· 20 18 #include <linux/acpi.h> 21 19 #include <acpi/battery.h> 22 20 23 - #define PREFIX "ACPI: " 24 - 25 21 #define ACPI_AC_CLASS "ac_adapter" 26 22 #define ACPI_AC_DEVICE_NAME "AC Adapter" 27 23 #define ACPI_AC_FILE_STATE "state" ··· 27 27 #define ACPI_AC_STATUS_OFFLINE 0x00 28 28 #define ACPI_AC_STATUS_ONLINE 0x01 29 29 #define ACPI_AC_STATUS_UNKNOWN 0xFF 30 - 31 - #define _COMPONENT ACPI_AC_COMPONENT 32 - ACPI_MODULE_NAME("ac"); 33 30 34 31 MODULE_AUTHOR("Paul Diefenbaugh"); 35 32 MODULE_DESCRIPTION("ACPI AC Adapter Driver"); ··· 99 102 status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL, 100 103 &ac->state); 101 104 if (ACPI_FAILURE(status)) { 102 - ACPI_EXCEPTION((AE_INFO, status, 103 - "Error reading AC Adapter state")); 105 + acpi_handle_info(ac->device->handle, 106 + "Error reading AC Adapter state: %s\n", 107 + acpi_format_exception(status)); 104 108 ac->state = ACPI_AC_STATUS_UNKNOWN; 105 109 return -ENODEV; 106 110 } ··· 151 153 152 154 switch (event) { 153 155 default: 154 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 155 - "Unsupported event [0x%x]\n", event)); 156 + acpi_handle_debug(device->handle, "Unsupported event [0x%x]\n", 157 + event); 156 158 fallthrough; 157 159 case ACPI_AC_NOTIFY_STATUS: 158 160 case ACPI_NOTIFY_BUS_CHECK: ··· 276 278 goto end; 277 279 } 278 280 279 - printk(KERN_INFO PREFIX "%s [%s] (%s)\n", 280 - acpi_device_name(device), acpi_device_bid(device), 281 - ac->state ? "on-line" : "off-line"); 281 + pr_info("%s [%s] (%s)\n", acpi_device_name(device), 282 + acpi_device_bid(device), ac->state ? "on-line" : "off-line"); 282 283 283 284 ac->battery_nb.notifier_call = acpi_ac_battery_notify; 284 285 register_acpi_notifier(&ac->battery_nb); ··· 345 348 for (i = 0; i < ARRAY_SIZE(acpi_ac_blacklist); i++) 346 349 if (acpi_dev_present(acpi_ac_blacklist[i].hid, "1", 347 350 acpi_ac_blacklist[i].hrv)) { 348 - pr_info(PREFIX "AC: found native %s PMIC, not loading\n", 351 + pr_info("found native %s PMIC, not loading\n", 349 352 acpi_ac_blacklist[i].hid); 350 353 return -ENODEV; 351 354 }
+51 -48
drivers/acpi/acpi_video.c
··· 7 7 * Copyright (C) 2006 Thomas Tuttle <linux-kernel@ttuttle.net> 8 8 */ 9 9 10 + #define pr_fmt(fmt) "ACPI: video: " fmt 11 + 10 12 #include <linux/kernel.h> 11 13 #include <linux/module.h> 12 14 #include <linux/init.h> ··· 28 26 #include <acpi/video.h> 29 27 #include <linux/uaccess.h> 30 28 31 - #define PREFIX "ACPI: " 32 - 33 29 #define ACPI_VIDEO_BUS_NAME "Video Bus" 34 30 #define ACPI_VIDEO_DEVICE_NAME "Video Device" 35 31 36 32 #define MAX_NAME_LEN 20 37 - 38 - #define _COMPONENT ACPI_VIDEO_COMPONENT 39 - ACPI_MODULE_NAME("video"); 40 33 41 34 MODULE_AUTHOR("Bruno Ducrot"); 42 35 MODULE_DESCRIPTION("ACPI Video Driver"); ··· 323 326 *levels = NULL; 324 327 325 328 status = acpi_evaluate_object(handle, "_BCL", NULL, &buffer); 326 - if (!ACPI_SUCCESS(status)) 329 + if (ACPI_FAILURE(status)) 327 330 return status; 328 331 obj = (union acpi_object *)buffer.pointer; 329 332 if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) { 330 - printk(KERN_ERR PREFIX "Invalid _BCL data\n"); 333 + acpi_handle_info(handle, "Invalid _BCL data\n"); 331 334 status = -EFAULT; 332 335 goto err; 333 336 } ··· 351 354 status = acpi_execute_simple_method(device->dev->handle, 352 355 "_BCM", level); 353 356 if (ACPI_FAILURE(status)) { 354 - ACPI_ERROR((AE_INFO, "Evaluating _BCM failed")); 357 + acpi_handle_info(device->dev->handle, "_BCM evaluation failed\n"); 355 358 return -EIO; 356 359 } 357 360 ··· 365 368 return 0; 366 369 } 367 370 368 - ACPI_ERROR((AE_INFO, "Current brightness invalid")); 371 + acpi_handle_info(device->dev->handle, "Current brightness invalid\n"); 369 372 return -EINVAL; 370 373 } 371 374 ··· 619 622 * BQC returned an invalid level. 620 623 * Stop using it. 621 624 */ 622 - ACPI_WARNING((AE_INFO, 623 - "%s returned an invalid level", 624 - buf)); 625 + acpi_handle_info(device->dev->handle, 626 + "%s returned an invalid level", buf); 625 627 device->cap._BQC = device->cap._BCQ = 0; 626 628 } else { 627 629 /* ··· 631 635 * ACPI video backlight still works w/ buggy _BQC. 632 636 * http://bugzilla.kernel.org/show_bug.cgi?id=12233 633 637 */ 634 - ACPI_WARNING((AE_INFO, "Evaluating %s failed", buf)); 638 + acpi_handle_info(device->dev->handle, 639 + "%s evaluation failed", buf); 635 640 device->cap._BQC = device->cap._BCQ = 0; 636 641 } 637 642 } ··· 672 675 if (obj && obj->type == ACPI_TYPE_BUFFER) 673 676 *edid = obj; 674 677 else { 675 - printk(KERN_ERR PREFIX "Invalid _DDC data\n"); 678 + acpi_handle_info(device->dev->handle, "Invalid _DDC data\n"); 676 679 status = -EFAULT; 677 680 kfree(obj); 678 681 } ··· 824 827 int result = 0; 825 828 u32 value; 826 829 827 - if (!ACPI_SUCCESS(acpi_video_device_lcd_query_levels(device->handle, 828 - &obj))) { 829 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Could not query available " 830 - "LCD brightness level\n")); 830 + if (ACPI_FAILURE(acpi_video_device_lcd_query_levels(device->handle, &obj))) { 831 + acpi_handle_debug(device->handle, 832 + "Could not query available LCD brightness level\n"); 831 833 result = -ENODEV; 832 834 goto out; 833 835 } ··· 838 842 839 843 br = kzalloc(sizeof(*br), GFP_KERNEL); 840 844 if (!br) { 841 - printk(KERN_ERR "can't allocate memory\n"); 842 845 result = -ENOMEM; 843 846 goto out; 844 847 } ··· 858 863 for (i = 0; i < obj->package.count; i++) { 859 864 o = (union acpi_object *)&obj->package.elements[i]; 860 865 if (o->type != ACPI_TYPE_INTEGER) { 861 - printk(KERN_ERR PREFIX "Invalid data\n"); 866 + acpi_handle_info(device->handle, "Invalid data\n"); 862 867 continue; 863 868 } 864 869 value = (u32) o->integer.value; ··· 895 900 br->levels[i] = br->levels[i - level_ac_battery]; 896 901 count += level_ac_battery; 897 902 } else if (level_ac_battery > ACPI_VIDEO_FIRST_LEVEL) 898 - ACPI_ERROR((AE_INFO, "Too many duplicates in _BCL package")); 903 + acpi_handle_info(device->handle, 904 + "Too many duplicates in _BCL package"); 899 905 900 906 /* Check if the _BCL package is in a reversed order */ 901 907 if (max_level == br->levels[ACPI_VIDEO_FIRST_LEVEL]) { ··· 906 910 sizeof(br->levels[ACPI_VIDEO_FIRST_LEVEL]), 907 911 acpi_video_cmp_level, NULL); 908 912 } else if (max_level != br->levels[count - 1]) 909 - ACPI_ERROR((AE_INFO, 910 - "Found unordered _BCL package")); 913 + acpi_handle_info(device->handle, 914 + "Found unordered _BCL package"); 911 915 912 916 br->count = count; 913 917 *dev_br = br; ··· 985 989 if (result) 986 990 goto out_free_levels; 987 991 988 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 989 - "found %d brightness levels\n", 990 - br->count - ACPI_VIDEO_FIRST_LEVEL)); 992 + acpi_handle_debug(device->dev->handle, "found %d brightness levels\n", 993 + br->count - ACPI_VIDEO_FIRST_LEVEL); 994 + 991 995 return 0; 992 996 993 997 out_free_levels: ··· 1019 1023 if (acpi_has_method(device->dev->handle, "_BQC")) { 1020 1024 device->cap._BQC = 1; 1021 1025 } else if (acpi_has_method(device->dev->handle, "_BCQ")) { 1022 - printk(KERN_WARNING FW_BUG "_BCQ is used instead of _BQC\n"); 1026 + acpi_handle_info(device->dev->handle, 1027 + "_BCQ is used instead of _BQC\n"); 1023 1028 device->cap._BCQ = 1; 1024 1029 } 1025 1030 ··· 1080 1083 /* Does this device support video switching? */ 1081 1084 if (video->cap._DOS || video->cap._DOD) { 1082 1085 if (!video->cap._DOS) { 1083 - printk(KERN_WARNING FW_BUG 1084 - "ACPI(%s) defines _DOD but not _DOS\n", 1086 + pr_info(FW_BUG "ACPI(%s) defines _DOD but not _DOS\n", 1085 1087 acpi_device_bid(video->device)); 1086 1088 } 1087 1089 video->flags.multihead = 1; ··· 1268 1272 ids = &video->attached_array[i]; 1269 1273 if (device->device_id == (ids->value.int_val & 0xffff)) { 1270 1274 ids->bind_info = device; 1271 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "device_bind %d\n", i)); 1275 + acpi_handle_debug(video->device->handle, "%s: %d\n", 1276 + __func__, i); 1272 1277 } 1273 1278 } 1274 1279 } ··· 1321 1324 return AE_NOT_EXIST; 1322 1325 1323 1326 status = acpi_evaluate_object(video->device->handle, "_DOD", NULL, &buffer); 1324 - if (!ACPI_SUCCESS(status)) { 1325 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _DOD")); 1327 + if (ACPI_FAILURE(status)) { 1328 + acpi_handle_info(video->device->handle, 1329 + "_DOD evaluation failed: %s\n", 1330 + acpi_format_exception(status)); 1326 1331 return status; 1327 1332 } 1328 1333 1329 1334 dod = buffer.pointer; 1330 1335 if (!dod || (dod->type != ACPI_TYPE_PACKAGE)) { 1331 - ACPI_EXCEPTION((AE_INFO, status, "Invalid _DOD data")); 1336 + acpi_handle_info(video->device->handle, "Invalid _DOD data\n"); 1332 1337 status = -EFAULT; 1333 1338 goto out; 1334 1339 } 1335 1340 1336 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d video heads in _DOD\n", 1337 - dod->package.count)); 1341 + acpi_handle_debug(video->device->handle, "Found %d video heads in _DOD\n", 1342 + dod->package.count); 1338 1343 1339 1344 active_list = kcalloc(1 + dod->package.count, 1340 1345 sizeof(struct acpi_video_enumerated_device), ··· 1351 1352 obj = &dod->package.elements[i]; 1352 1353 1353 1354 if (obj->type != ACPI_TYPE_INTEGER) { 1354 - printk(KERN_ERR PREFIX 1355 - "Invalid _DOD data in element %d\n", i); 1355 + acpi_handle_info(video->device->handle, 1356 + "Invalid _DOD data in element %d\n", i); 1356 1357 continue; 1357 1358 } 1358 1359 1359 1360 active_list[count].value.int_val = obj->integer.value; 1360 1361 active_list[count].bind_info = NULL; 1361 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "dod element[%d] = %d\n", i, 1362 - (int)obj->integer.value)); 1362 + 1363 + acpi_handle_debug(video->device->handle, 1364 + "_DOD element[%d] = %d\n", i, 1365 + (int)obj->integer.value); 1366 + 1363 1367 count++; 1364 1368 } 1365 1369 ··· 1453 1451 1454 1452 out: 1455 1453 if (result) 1456 - printk(KERN_ERR PREFIX "Failed to switch the brightness\n"); 1454 + acpi_handle_info(device->dev->handle, 1455 + "Failed to switch brightness\n"); 1457 1456 } 1458 1457 1459 1458 int acpi_video_get_edid(struct acpi_device *device, int type, int device_id, ··· 1604 1601 break; 1605 1602 1606 1603 default: 1607 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 1608 - "Unsupported event [0x%x]\n", event)); 1604 + acpi_handle_debug(device->handle, "Unsupported event [0x%x]\n", 1605 + event); 1609 1606 break; 1610 1607 } 1611 1608 ··· 1678 1675 keycode = KEY_DISPLAY_OFF; 1679 1676 break; 1680 1677 default: 1681 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 1682 - "Unsupported event [0x%x]\n", event)); 1678 + acpi_handle_debug(handle, "Unsupported event [0x%x]\n", event); 1683 1679 break; 1684 1680 } 1685 1681 ··· 1814 1812 &device->cooling_dev->device.kobj, 1815 1813 "thermal_cooling"); 1816 1814 if (result) 1817 - printk(KERN_ERR PREFIX "Create sysfs link\n"); 1815 + pr_info("sysfs link creation failed\n"); 1816 + 1818 1817 result = sysfs_create_link(&device->cooling_dev->device.kobj, 1819 1818 &device->dev->dev.kobj, "device"); 1820 1819 if (result) 1821 - printk(KERN_ERR PREFIX "Create sysfs link\n"); 1820 + pr_info("Reverse sysfs link creation failed\n"); 1822 1821 } 1823 1822 1824 1823 static void acpi_video_run_bcl_for_osi(struct acpi_video_bus *video) ··· 2033 2030 acpi_video_bus_match, NULL, 2034 2031 device, NULL); 2035 2032 if (status == AE_ALREADY_EXISTS) { 2036 - printk(KERN_WARNING FW_BUG 2033 + pr_info(FW_BUG 2037 2034 "Duplicate ACPI video bus devices for the" 2038 2035 " same VGA controller, please try module " 2039 2036 "parameter \"video.allow_duplicates=1\"" ··· 2076 2073 if (error) 2077 2074 goto err_put_video; 2078 2075 2079 - printk(KERN_INFO PREFIX "%s [%s] (multi-head: %s rom: %s post: %s)\n", 2076 + pr_info("%s [%s] (multi-head: %s rom: %s post: %s)\n", 2080 2077 ACPI_VIDEO_DEVICE_NAME, acpi_device_bid(device), 2081 2078 video->flags.multihead ? "yes" : "no", 2082 2079 video->flags.rom ? "yes" : "no",
+16 -17
drivers/acpi/battery.c
··· 8 8 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> 9 9 */ 10 10 11 - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 11 + #define pr_fmt(fmt) "ACPI: battery: " fmt 12 12 13 13 #include <linux/async.h> 14 14 #include <linux/delay.h> ··· 29 29 30 30 #include <acpi/battery.h> 31 31 32 - #define PREFIX "ACPI: " 33 - 34 32 #define ACPI_BATTERY_VALUE_UNKNOWN 0xFFFFFFFF 35 33 #define ACPI_BATTERY_CAPACITY_VALID(capacity) \ 36 34 ((capacity) != 0 && (capacity) != ACPI_BATTERY_VALUE_UNKNOWN) ··· 41 43 #define ACPI_BATTERY_STATE_DISCHARGING 0x1 42 44 #define ACPI_BATTERY_STATE_CHARGING 0x2 43 45 #define ACPI_BATTERY_STATE_CRITICAL 0x4 44 - 45 - #define _COMPONENT ACPI_BATTERY_COMPONENT 46 - 47 - ACPI_MODULE_NAME("battery"); 48 46 49 47 MODULE_AUTHOR("Paul Diefenbaugh"); 50 48 MODULE_AUTHOR("Alexey Starikovskiy <astarikovskiy@suse.de>"); ··· 460 466 static int acpi_battery_get_status(struct acpi_battery *battery) 461 467 { 462 468 if (acpi_bus_get_status(battery->device)) { 463 - ACPI_EXCEPTION((AE_INFO, AE_ERROR, "Evaluating _STA")); 469 + acpi_handle_info(battery->device->handle, 470 + "_STA evaluation failed\n"); 464 471 return -ENODEV; 465 472 } 466 473 return 0; ··· 530 535 mutex_unlock(&battery->lock); 531 536 532 537 if (ACPI_FAILURE(status)) { 533 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating %s", 534 - use_bix ? "_BIX":"_BIF")); 538 + acpi_handle_info(battery->device->handle, 539 + "%s evaluation failed: %s\n", 540 + use_bix ?"_BIX":"_BIF", 541 + acpi_format_exception(status)); 535 542 } else { 536 543 result = extract_battery_info(use_bix, 537 544 battery, ··· 570 573 mutex_unlock(&battery->lock); 571 574 572 575 if (ACPI_FAILURE(status)) { 573 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST")); 576 + acpi_handle_info(battery->device->handle, 577 + "_BST evaluation failed: %s", 578 + acpi_format_exception(status)); 574 579 return -ENODEV; 575 580 } 576 581 ··· 589 590 battery->rate_now != ACPI_BATTERY_VALUE_UNKNOWN && 590 591 (s16)(battery->rate_now) < 0) { 591 592 battery->rate_now = abs((s16)battery->rate_now); 592 - pr_warn_once(FW_BUG "battery: (dis)charge rate invalid.\n"); 593 + pr_warn_once(FW_BUG "(dis)charge rate invalid.\n"); 593 594 } 594 595 595 596 if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags) ··· 624 625 if (ACPI_FAILURE(status)) 625 626 return -ENODEV; 626 627 627 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Alarm set to %d\n", battery->alarm)); 628 + acpi_handle_debug(battery->device->handle, "Alarm set to %d\n", 629 + battery->alarm); 630 + 628 631 return 0; 629 632 } 630 633 ··· 1202 1201 if (result) 1203 1202 goto fail; 1204 1203 1205 - pr_info(PREFIX "%s Slot [%s] (battery %s)\n", 1206 - ACPI_BATTERY_DEVICE_NAME, acpi_device_bid(device), 1204 + pr_info("Slot [%s] (battery %s)\n", acpi_device_bid(device), 1207 1205 device->status.battery_present ? "present" : "absent"); 1208 1206 1209 1207 battery->pm_nb.notifier_call = battery_notify; ··· 1282 1282 if (battery_check_pmic) { 1283 1283 for (i = 0; i < ARRAY_SIZE(acpi_battery_blacklist); i++) 1284 1284 if (acpi_dev_present(acpi_battery_blacklist[i], "1", -1)) { 1285 - pr_info(PREFIX ACPI_BATTERY_DEVICE_NAME 1286 - ": found native %s PMIC, not loading\n", 1285 + pr_info("found native %s PMIC, not loading\n", 1287 1286 acpi_battery_blacklist[i]); 1288 1287 return; 1289 1288 }
+26 -34
drivers/acpi/bus.c
··· 5 5 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> 6 6 */ 7 7 8 + #define pr_fmt(fmt) "ACPI: " fmt 9 + 8 10 #include <linux/module.h> 9 11 #include <linux/init.h> 10 12 #include <linux/ioport.h> ··· 33 31 34 32 #include "internal.h" 35 33 36 - #define _COMPONENT ACPI_BUS_COMPONENT 37 - ACPI_MODULE_NAME("bus"); 38 - 39 34 struct acpi_device *acpi_root; 40 35 struct proc_dir_entry *acpi_root_dir; 41 36 EXPORT_SYMBOL(acpi_root_dir); ··· 46 47 #else 47 48 static int set_copy_dsdt(const struct dmi_system_id *id) 48 49 { 49 - printk(KERN_NOTICE "%s detected - " 50 - "force copy of DSDT to local memory\n", id->ident); 50 + pr_notice("%s detected - force copy of DSDT to local memory\n", id->ident); 51 51 acpi_gbl_copy_dsdt_locally = 1; 52 52 return 0; 53 53 } ··· 114 116 acpi_set_device_status(device, sta); 115 117 116 118 if (device->status.functional && !device->status.present) { 117 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]: " 118 - "functional but not present;\n", 119 - device->pnp.bus_id, (u32)sta)); 119 + pr_debug("Device [%s] status [%08x]: functional but not present\n", 120 + device->pnp.bus_id, (u32)sta); 120 121 } 121 122 122 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]\n", 123 - device->pnp.bus_id, (u32)sta)); 123 + pr_debug("Device [%s] status [%08x]\n", device->pnp.bus_id, (u32)sta); 124 124 return 0; 125 125 } 126 126 EXPORT_SYMBOL(acpi_bus_get_status); ··· 911 915 return ret; 912 916 913 917 acpi_dev->driver = acpi_drv; 914 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 915 - "Driver [%s] successfully bound to device [%s]\n", 916 - acpi_drv->name, acpi_dev->pnp.bus_id)); 918 + 919 + pr_debug("Driver [%s] successfully bound to device [%s]\n", 920 + acpi_drv->name, acpi_dev->pnp.bus_id); 917 921 918 922 if (acpi_drv->ops.notify) { 919 923 ret = acpi_device_install_notify_handler(acpi_dev); ··· 927 931 } 928 932 } 929 933 930 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found driver [%s] for device [%s]\n", 931 - acpi_drv->name, acpi_dev->pnp.bus_id)); 934 + pr_debug("Found driver [%s] for device [%s]\n", acpi_drv->name, 935 + acpi_dev->pnp.bus_id); 936 + 932 937 get_device(dev); 933 938 return 0; 934 939 } ··· 992 995 message = "platform specific model"; 993 996 break; 994 997 default: 995 - printk(KERN_WARNING PREFIX "Unknown interrupt routing model\n"); 998 + pr_info("Unknown interrupt routing model\n"); 996 999 return -ENODEV; 997 1000 } 998 1001 999 - printk(KERN_INFO PREFIX "Using %s for interrupt routing\n", message); 1002 + pr_info("Using %s for interrupt routing\n", message); 1000 1003 1001 1004 status = acpi_execute_simple_method(NULL, "\\_PIC", acpi_irq_model); 1002 1005 if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) { 1003 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PIC")); 1006 + pr_info("_PIC evaluation failed: %s\n", acpi_format_exception(status)); 1004 1007 return -ENODEV; 1005 1008 } 1006 1009 ··· 1024 1027 if (acpi_disabled) 1025 1028 return; 1026 1029 1027 - printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION); 1030 + pr_info("Core revision %08x\n", ACPI_CA_VERSION); 1028 1031 1029 1032 /* enable workarounds, unless strict ACPI spec. compliance */ 1030 1033 if (!acpi_strict) ··· 1045 1048 1046 1049 status = acpi_reallocate_root_table(); 1047 1050 if (ACPI_FAILURE(status)) { 1048 - printk(KERN_ERR PREFIX 1049 - "Unable to reallocate ACPI tables\n"); 1051 + pr_err("Unable to reallocate ACPI tables\n"); 1050 1052 goto error0; 1051 1053 } 1052 1054 1053 1055 status = acpi_initialize_subsystem(); 1054 1056 if (ACPI_FAILURE(status)) { 1055 - printk(KERN_ERR PREFIX 1056 - "Unable to initialize the ACPI Interpreter\n"); 1057 + pr_err("Unable to initialize the ACPI Interpreter\n"); 1057 1058 goto error0; 1058 1059 } 1059 1060 ··· 1097 1102 1098 1103 status = acpi_enable_subsystem(~ACPI_NO_ACPI_ENABLE); 1099 1104 if (ACPI_FAILURE(status)) { 1100 - printk(KERN_ERR PREFIX "Unable to enable ACPI\n"); 1105 + pr_err("Unable to enable ACPI\n"); 1101 1106 disable_acpi(); 1102 1107 } else { 1103 1108 /* ··· 1126 1131 1127 1132 status = acpi_load_tables(); 1128 1133 if (ACPI_FAILURE(status)) { 1129 - printk(KERN_ERR PREFIX 1130 - "Unable to load the System Description Tables\n"); 1134 + pr_err("Unable to load the System Description Tables\n"); 1131 1135 goto error1; 1132 1136 } 1133 1137 ··· 1144 1150 1145 1151 status = acpi_enable_subsystem(ACPI_NO_ACPI_ENABLE); 1146 1152 if (ACPI_FAILURE(status)) { 1147 - printk(KERN_ERR PREFIX 1148 - "Unable to start the ACPI Interpreter\n"); 1153 + pr_err("Unable to start the ACPI Interpreter\n"); 1149 1154 goto error1; 1150 1155 } 1151 1156 1152 1157 status = acpi_initialize_objects(ACPI_FULL_INITIALIZATION); 1153 1158 if (ACPI_FAILURE(status)) { 1154 - printk(KERN_ERR PREFIX "Unable to initialize ACPI objects\n"); 1159 + pr_err("Unable to initialize ACPI objects\n"); 1155 1160 goto error1; 1156 1161 } 1157 1162 ··· 1179 1186 */ 1180 1187 acpi_ec_dsdt_probe(); 1181 1188 1182 - printk(KERN_INFO PREFIX "Interpreter enabled\n"); 1189 + pr_info("Interpreter enabled\n"); 1183 1190 1184 1191 /* Initialize sleep structures */ 1185 1192 acpi_sleep_init(); ··· 1198 1205 acpi_install_notify_handler(ACPI_ROOT_OBJECT, ACPI_SYSTEM_NOTIFY, 1199 1206 &acpi_bus_notify, NULL); 1200 1207 if (ACPI_FAILURE(status)) { 1201 - printk(KERN_ERR PREFIX 1202 - "Unable to register for device notifications\n"); 1208 + pr_err("Unable to register for system notifications\n"); 1203 1209 goto error1; 1204 1210 } 1205 1211 ··· 1225 1233 int result; 1226 1234 1227 1235 if (acpi_disabled) { 1228 - printk(KERN_INFO PREFIX "Interpreter disabled.\n"); 1236 + pr_info("Interpreter disabled.\n"); 1229 1237 return -ENODEV; 1230 1238 } 1231 1239 1232 1240 acpi_kobj = kobject_create_and_add("acpi", firmware_kobj); 1233 1241 if (!acpi_kobj) { 1234 - printk(KERN_WARNING "%s: kset create error\n", __func__); 1242 + pr_debug("%s: kset create error\n", __func__); 1235 1243 acpi_kobj = NULL; 1236 1244 } 1237 1245
+5 -10
drivers/acpi/button.c
··· 21 21 #include <linux/dmi.h> 22 22 #include <acpi/button.h> 23 23 24 - #define PREFIX "ACPI: " 25 - 26 24 #define ACPI_BUTTON_CLASS "button" 27 25 #define ACPI_BUTTON_FILE_STATE "state" 28 26 #define ACPI_BUTTON_TYPE_UNKNOWN 0x00 ··· 51 53 [ACPI_BUTTON_LID_INIT_METHOD] = "method", 52 54 [ACPI_BUTTON_LID_INIT_DISABLED] = "disabled", 53 55 }; 54 - 55 - #define _COMPONENT ACPI_BUTTON_COMPONENT 56 - ACPI_MODULE_NAME("button"); 57 56 58 57 MODULE_AUTHOR("Paul Diefenbaugh"); 59 58 MODULE_DESCRIPTION("ACPI Button Driver"); ··· 280 285 return 0; 281 286 282 287 if (acpi_button_dir || acpi_lid_dir) { 283 - printk(KERN_ERR PREFIX "More than one Lid device found!\n"); 288 + pr_info("More than one Lid device found!\n"); 284 289 return -EEXIST; 285 290 } 286 291 ··· 429 434 } 430 435 break; 431 436 default: 432 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 433 - "Unsupported event [0x%x]\n", event)); 437 + acpi_handle_debug(device->handle, "Unsupported event [0x%x]\n", 438 + event); 434 439 break; 435 440 } 436 441 } ··· 518 523 ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID); 519 524 input->open = acpi_lid_input_open; 520 525 } else { 521 - printk(KERN_ERR PREFIX "Unsupported hid [%s]\n", hid); 526 + pr_info("Unsupported hid [%s]\n", hid); 522 527 error = -ENODEV; 523 528 goto err_free_input; 524 529 } ··· 562 567 } 563 568 564 569 device_init_wakeup(&device->dev, true); 565 - printk(KERN_INFO PREFIX "%s [%s]\n", name, acpi_device_bid(device)); 570 + pr_info("%s [%s]\n", name, acpi_device_bid(device)); 566 571 return 0; 567 572 568 573 err_remove_fs:
+8 -12
drivers/acpi/device_pm.c
··· 10 10 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 11 11 */ 12 12 13 + #define pr_fmt(fmt) "ACPI: PM: " fmt 14 + 13 15 #include <linux/acpi.h> 14 16 #include <linux/export.h> 15 17 #include <linux/mutex.h> ··· 21 19 #include <linux/suspend.h> 22 20 23 21 #include "internal.h" 24 - 25 - #define _COMPONENT ACPI_POWER_COMPONENT 26 - ACPI_MODULE_NAME("device_pm"); 27 22 28 23 /** 29 24 * acpi_power_state_string - String representation of ACPI device power state. ··· 129 130 *state = result; 130 131 131 132 out: 132 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] power state is %s\n", 133 - device->pnp.bus_id, acpi_power_state_string(*state))); 133 + dev_dbg(&device->dev, "Device power state is %s\n", 134 + acpi_power_state_string(*state)); 134 135 135 136 return 0; 136 137 } ··· 173 174 174 175 /* There is a special case for D0 addressed below. */ 175 176 if (state > ACPI_STATE_D0 && state == device->power.state) { 176 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] already in %s\n", 177 - device->pnp.bus_id, 178 - acpi_power_state_string(state))); 177 + dev_dbg(&device->dev, "Device already in %s\n", 178 + acpi_power_state_string(state)); 179 179 return 0; 180 180 } 181 181 ··· 274 276 acpi_power_state_string(target_state)); 275 277 } else { 276 278 device->power.state = target_state; 277 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 278 - "Device [%s] transitioned to %s\n", 279 - device->pnp.bus_id, 280 - acpi_power_state_string(target_state))); 279 + dev_dbg(&device->dev, "Power state changed to %s\n", 280 + acpi_power_state_string(target_state)); 281 281 } 282 282 283 283 return result;
+31 -42
drivers/acpi/osl.c
··· 9 9 * Author: Matthew Wilcox <willy@linux.intel.com> 10 10 */ 11 11 12 + #define pr_fmt(fmt) "ACPI: OSL: " fmt 13 + 12 14 #include <linux/module.h> 13 15 #include <linux/kernel.h> 14 16 #include <linux/slab.h> ··· 39 37 #include "acpica/acnamesp.h" 40 38 #include "internal.h" 41 39 40 + /* Definitions for ACPI_DEBUG_PRINT() */ 42 41 #define _COMPONENT ACPI_OS_SERVICES 43 42 ACPI_MODULE_NAME("osl"); 44 43 ··· 330 327 acpi_size pg_sz; 331 328 332 329 if (phys > ULONG_MAX) { 333 - printk(KERN_ERR PREFIX "Cannot map memory that high\n"); 330 + pr_err("Cannot map memory that high: 0x%llx\n", phys); 334 331 return NULL; 335 332 } 336 333 ··· 531 528 532 529 *new_val = NULL; 533 530 if (!memcmp(init_val->name, "_OS_", 4) && strlen(acpi_os_name)) { 534 - printk(KERN_INFO PREFIX "Overriding _OS definition to '%s'\n", 535 - acpi_os_name); 531 + pr_info("Overriding _OS definition to '%s'\n", acpi_os_name); 536 532 *new_val = acpi_os_name; 537 533 } 538 534 539 535 if (!memcmp(init_val->name, "_REV", 4) && acpi_rev_override) { 540 - printk(KERN_INFO PREFIX "Overriding _REV return value to 5\n"); 536 + pr_info("Overriding _REV return value to 5\n"); 541 537 *new_val = (char *)5; 542 538 } 543 539 ··· 577 575 return AE_ALREADY_ACQUIRED; 578 576 579 577 if (acpi_gsi_to_irq(gsi, &irq) < 0) { 580 - printk(KERN_ERR PREFIX "SCI (ACPI GSI %d) not registered\n", 581 - gsi); 578 + pr_err("SCI (ACPI GSI %d) not registered\n", gsi); 582 579 return AE_OK; 583 580 } 584 581 585 582 acpi_irq_handler = handler; 586 583 acpi_irq_context = context; 587 584 if (request_irq(irq, acpi_irq, IRQF_SHARED, "acpi", acpi_irq)) { 588 - printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq); 585 + pr_err("SCI (IRQ%d) allocation failed\n", irq); 589 586 acpi_irq_handler = NULL; 590 587 return AE_NOT_ACQUIRED; 591 588 } ··· 1072 1071 if (type == OSL_DEBUGGER_MAIN_THREAD) { 1073 1072 ret = acpi_debugger_create_thread(function, context); 1074 1073 if (ret) { 1075 - pr_err("Call to kthread_create() failed.\n"); 1074 + pr_err("Kernel thread creation failed\n"); 1076 1075 status = AE_ERROR; 1077 1076 } 1078 1077 goto out_thread; ··· 1122 1121 */ 1123 1122 ret = queue_work_on(0, queue, &dpc->work); 1124 1123 if (!ret) { 1125 - printk(KERN_ERR PREFIX 1126 - "Call to queue_work() failed.\n"); 1124 + pr_err("Unable to queue work\n"); 1127 1125 status = AE_ERROR; 1128 1126 } 1129 1127 err_workqueue: ··· 1165 1165 { 1166 1166 struct acpi_hp_work *hpw; 1167 1167 1168 - ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 1169 - "Scheduling hotplug event (%p, %u) for deferred execution.\n", 1170 - adev, src)); 1168 + acpi_handle_debug(adev->handle, 1169 + "Scheduling hotplug event %u for deferred handling\n", 1170 + src); 1171 1171 1172 1172 hpw = kmalloc(sizeof(*hpw), GFP_KERNEL); 1173 1173 if (!hpw) ··· 1355 1355 { 1356 1356 switch (function) { 1357 1357 case ACPI_SIGNAL_FATAL: 1358 - printk(KERN_ERR PREFIX "Fatal opcode executed\n"); 1358 + pr_err("Fatal opcode executed\n"); 1359 1359 break; 1360 1360 case ACPI_SIGNAL_BREAKPOINT: 1361 1361 /* ··· 1407 1407 static int __init acpi_no_auto_serialize_setup(char *str) 1408 1408 { 1409 1409 acpi_gbl_auto_serialize_methods = FALSE; 1410 - pr_info("ACPI: auto-serialization disabled\n"); 1410 + pr_info("Auto-serialization disabled\n"); 1411 1411 1412 1412 return 1; 1413 1413 } ··· 1458 1458 int acpi_check_resource_conflict(const struct resource *res) 1459 1459 { 1460 1460 acpi_adr_space_type space_id; 1461 - acpi_size length; 1462 - u8 warn = 0; 1463 - int clash = 0; 1464 1461 1465 1462 if (acpi_enforce_resources == ENFORCE_RESOURCES_NO) 1466 - return 0; 1467 - if (!(res->flags & IORESOURCE_IO) && !(res->flags & IORESOURCE_MEM)) 1468 1463 return 0; 1469 1464 1470 1465 if (res->flags & IORESOURCE_IO) 1471 1466 space_id = ACPI_ADR_SPACE_SYSTEM_IO; 1472 - else 1467 + else if (res->flags & IORESOURCE_MEM) 1473 1468 space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY; 1469 + else 1470 + return 0; 1474 1471 1475 - length = resource_size(res); 1476 - if (acpi_enforce_resources != ENFORCE_RESOURCES_NO) 1477 - warn = 1; 1478 - clash = acpi_check_address_range(space_id, res->start, length, warn); 1472 + if (!acpi_check_address_range(space_id, res->start, resource_size(res), 1)) 1473 + return 0; 1479 1474 1480 - if (clash) { 1481 - if (acpi_enforce_resources != ENFORCE_RESOURCES_NO) { 1482 - if (acpi_enforce_resources == ENFORCE_RESOURCES_LAX) 1483 - printk(KERN_NOTICE "ACPI: This conflict may" 1484 - " cause random problems and system" 1485 - " instability\n"); 1486 - printk(KERN_INFO "ACPI: If an ACPI driver is available" 1487 - " for this device, you should use it instead of" 1488 - " the native driver\n"); 1489 - } 1490 - if (acpi_enforce_resources == ENFORCE_RESOURCES_STRICT) 1491 - return -EBUSY; 1492 - } 1475 + pr_info("Resource conflict; ACPI support missing from driver?\n"); 1476 + 1477 + if (acpi_enforce_resources == ENFORCE_RESOURCES_STRICT) 1478 + return -EBUSY; 1479 + 1480 + if (acpi_enforce_resources == ENFORCE_RESOURCES_LAX) 1481 + pr_notice("Resource conflict: System may be unstable or behave erratically\n"); 1482 + 1493 1483 return 0; 1494 1484 } 1495 1485 EXPORT_SYMBOL(acpi_check_resource_conflict); ··· 1712 1722 static int __init acpi_no_static_ssdt_setup(char *s) 1713 1723 { 1714 1724 acpi_gbl_disable_ssdt_table_install = TRUE; 1715 - pr_info("ACPI: static SSDT installation disabled\n"); 1725 + pr_info("Static SSDT installation disabled\n"); 1716 1726 1717 1727 return 0; 1718 1728 } ··· 1721 1731 1722 1732 static int __init acpi_disable_return_repair(char *s) 1723 1733 { 1724 - printk(KERN_NOTICE PREFIX 1725 - "ACPI: Predefined validation mechanism disabled\n"); 1734 + pr_notice("Predefined validation mechanism disabled\n"); 1726 1735 acpi_gbl_disable_auto_repair = TRUE; 1727 1736 1728 1737 return 1; ··· 1747 1758 void *rv; 1748 1759 1749 1760 rv = acpi_os_map_generic_address(&acpi_gbl_FADT.reset_register); 1750 - pr_debug(PREFIX "%s: map reset_reg %s\n", __func__, 1761 + pr_debug("%s: Reset register mapping %s\n", __func__, 1751 1762 rv ? "successful" : "failed"); 1752 1763 } 1753 1764 acpi_os_initialized = true;
+15 -29
drivers/acpi/power.c
··· 21 21 * may be shared by multiple devices. 22 22 */ 23 23 24 + #define pr_fmt(fmt) "ACPI: PM: " fmt 25 + 24 26 #include <linux/kernel.h> 25 27 #include <linux/module.h> 26 28 #include <linux/init.h> ··· 34 32 #include "sleep.h" 35 33 #include "internal.h" 36 34 37 - #define _COMPONENT ACPI_POWER_COMPONENT 38 - ACPI_MODULE_NAME("power"); 39 35 #define ACPI_POWER_CLASS "power_resource" 40 36 #define ACPI_POWER_DEVICE_NAME "Power Resource" 41 37 #define ACPI_POWER_RESOURCE_STATE_OFF 0x00 ··· 181 181 { 182 182 acpi_status status = AE_OK; 183 183 unsigned long long sta = 0; 184 - char node_name[5]; 185 - struct acpi_buffer buffer = { sizeof(node_name), node_name }; 186 - 187 184 188 185 if (!handle || !state) 189 186 return -EINVAL; ··· 192 195 *state = (sta & 0x01)?ACPI_POWER_RESOURCE_STATE_ON: 193 196 ACPI_POWER_RESOURCE_STATE_OFF; 194 197 195 - acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer); 196 - 197 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n", 198 - node_name, 199 - *state ? "on" : "off")); 198 + acpi_handle_debug(handle, "Power resource is %s\n", 199 + *state ? "on" : "off"); 200 200 201 201 return 0; 202 202 } ··· 223 229 break; 224 230 } 225 231 226 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource list is %s\n", 227 - cur_state ? "on" : "off")); 232 + pr_debug("Power resource list is %s\n", cur_state ? "on" : "off"); 228 233 229 234 *state = cur_state; 230 235 return 0; ··· 350 357 if (ACPI_FAILURE(status)) 351 358 return -ENODEV; 352 359 353 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned on\n", 354 - resource->name)); 360 + pr_debug("Power resource [%s] turned on\n", resource->name); 355 361 356 362 /* 357 363 * If there are other dependents on this power resource we need to ··· 375 383 int result = 0; 376 384 377 385 if (resource->ref_count++) { 378 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 379 - "Power resource [%s] already on\n", 380 - resource->name)); 386 + pr_debug("Power resource [%s] already on\n", resource->name); 381 387 } else { 382 388 result = __acpi_power_on(resource); 383 389 if (result) ··· 403 413 if (ACPI_FAILURE(status)) 404 414 return -ENODEV; 405 415 406 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned off\n", 407 - resource->name)); 416 + pr_debug("Power resource [%s] turned off\n", resource->name); 417 + 408 418 return 0; 409 419 } 410 420 ··· 413 423 int result = 0; 414 424 415 425 if (!resource->ref_count) { 416 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 417 - "Power resource [%s] already off\n", 418 - resource->name)); 426 + pr_debug("Power resource [%s] already off\n", resource->name); 419 427 return 0; 420 428 } 421 429 422 430 if (--resource->ref_count) { 423 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 424 - "Power resource [%s] still in use\n", 425 - resource->name)); 431 + pr_debug("Power resource [%s] still in use\n", resource->name); 426 432 } else { 427 433 result = __acpi_power_off(resource); 428 434 if (result) ··· 658 672 if (ACPI_SUCCESS(status)) { 659 673 return 0; 660 674 } else if (status != AE_NOT_FOUND) { 661 - printk(KERN_ERR PREFIX "_DSW execution failed\n"); 675 + acpi_handle_info(dev->handle, "_DSW execution failed\n"); 662 676 dev->wakeup.flags.valid = 0; 663 677 return -ENODEV; 664 678 } ··· 666 680 /* Execute _PSW */ 667 681 status = acpi_execute_simple_method(dev->handle, "_PSW", enable); 668 682 if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) { 669 - printk(KERN_ERR PREFIX "_PSW execution failed\n"); 683 + acpi_handle_info(dev->handle, "_PSW execution failed\n"); 670 684 dev->wakeup.flags.valid = 0; 671 685 return -ENODEV; 672 686 } ··· 947 961 if (result) 948 962 goto err; 949 963 950 - printk(KERN_INFO PREFIX "%s [%s] (%s)\n", acpi_device_name(device), 951 - acpi_device_bid(device), state ? "on" : "off"); 964 + pr_info("%s [%s] (%s)\n", acpi_device_name(device), 965 + acpi_device_bid(device), state ? "on" : "off"); 952 966 953 967 device->flags.match_driver = true; 954 968 result = acpi_device_add(device, acpi_release_power_resource);
+12 -17
drivers/acpi/scan.c
··· 19 19 20 20 #include "internal.h" 21 21 22 - #define _COMPONENT ACPI_BUS_COMPONENT 23 - ACPI_MODULE_NAME("scan"); 24 22 extern struct acpi_device *acpi_root; 25 23 26 24 #define ACPI_BUS_CLASS "system_bus" ··· 263 265 return error; 264 266 } 265 267 266 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 267 - "Hot-removing device %s...\n", dev_name(&device->dev))); 268 + acpi_handle_debug(handle, "Ejecting\n"); 268 269 269 270 acpi_bus_trim(device); 270 271 ··· 826 829 /* _PRW */ 827 830 status = acpi_evaluate_object(handle, "_PRW", NULL, &buffer); 828 831 if (ACPI_FAILURE(status)) { 829 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRW")); 832 + acpi_handle_info(handle, "_PRW evaluation failed: %s\n", 833 + acpi_format_exception(status)); 830 834 return err; 831 835 } 832 836 ··· 932 934 933 935 err = acpi_bus_extract_wakeup_device_power_package(device); 934 936 if (err) { 935 - dev_err(&device->dev, "_PRW evaluation error: %d\n", err); 937 + dev_err(&device->dev, "Unable to extract wakeup power resources"); 936 938 return; 937 939 } 938 940 ··· 1168 1170 1169 1171 if (acpi_has_method(handle, "_BCM") && 1170 1172 acpi_has_method(handle, "_BCL")) { 1171 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found generic backlight " 1172 - "support\n")); 1173 + acpi_handle_debug(handle, "Found generic backlight support\n"); 1173 1174 *cap |= ACPI_VIDEO_BACKLIGHT; 1174 1175 /* We have backlight support, no need to scan further */ 1175 1176 return AE_CTRL_TERMINATE; ··· 1659 1662 acpi_handle handle, int type, 1660 1663 unsigned long long sta) 1661 1664 { 1662 - int result; 1663 - struct acpi_device *device; 1664 - struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 1665 1665 struct acpi_device_info *info = NULL; 1666 + struct acpi_device *device; 1667 + int result; 1666 1668 1667 1669 if (handle != ACPI_ROOT_OBJECT && type == ACPI_BUS_TYPE_DEVICE) 1668 1670 acpi_get_object_info(handle, &info); 1669 1671 1670 1672 device = kzalloc(sizeof(struct acpi_device), GFP_KERNEL); 1671 1673 if (!device) { 1672 - printk(KERN_ERR PREFIX "Memory allocation error\n"); 1673 1674 kfree(info); 1674 1675 return -ENOMEM; 1675 1676 } ··· 1694 1699 1695 1700 acpi_power_add_remove_device(device, true); 1696 1701 acpi_device_add_finalize(device); 1697 - acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); 1698 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Added %s [%s] parent %s\n", 1699 - dev_name(&device->dev), (char *) buffer.pointer, 1700 - device->parent ? dev_name(&device->parent->dev) : "(null)")); 1701 - kfree(buffer.pointer); 1702 + 1703 + acpi_handle_debug(handle, "Added as %s, parent %s\n", 1704 + dev_name(&device->dev), device->parent ? 1705 + dev_name(&device->parent->dev) : "(null)"); 1706 + 1702 1707 *child = device; 1703 1708 return 0; 1704 1709 }
-7
drivers/acpi/sysfs.c
··· 52 52 ACPI_DEBUG_INIT(ACPI_COMPILER), 53 53 ACPI_DEBUG_INIT(ACPI_TOOLS), 54 54 55 - ACPI_DEBUG_INIT(ACPI_BUS_COMPONENT), 56 - ACPI_DEBUG_INIT(ACPI_AC_COMPONENT), 57 - ACPI_DEBUG_INIT(ACPI_BATTERY_COMPONENT), 58 - ACPI_DEBUG_INIT(ACPI_BUTTON_COMPONENT), 59 55 ACPI_DEBUG_INIT(ACPI_SBS_COMPONENT), 60 56 ACPI_DEBUG_INIT(ACPI_FAN_COMPONENT), 61 57 ACPI_DEBUG_INIT(ACPI_PCI_COMPONENT), 62 - ACPI_DEBUG_INIT(ACPI_POWER_COMPONENT), 63 58 ACPI_DEBUG_INIT(ACPI_CONTAINER_COMPONENT), 64 59 ACPI_DEBUG_INIT(ACPI_SYSTEM_COMPONENT), 65 - ACPI_DEBUG_INIT(ACPI_THERMAL_COMPONENT), 66 60 ACPI_DEBUG_INIT(ACPI_MEMORY_DEVICE_COMPONENT), 67 - ACPI_DEBUG_INIT(ACPI_VIDEO_COMPONENT), 68 61 ACPI_DEBUG_INIT(ACPI_PROCESSOR_COMPONENT), 69 62 }; 70 63
+43 -44
drivers/acpi/thermal.c
··· 13 13 * concepts of 'multiple limiters', upper/lower limits, etc. 14 14 */ 15 15 16 + #define pr_fmt(fmt) "ACPI: thermal: " fmt 17 + 16 18 #include <linux/kernel.h> 17 19 #include <linux/module.h> 18 20 #include <linux/dmi.h> ··· 31 29 #include <linux/uaccess.h> 32 30 #include <linux/units.h> 33 31 34 - #define PREFIX "ACPI: " 35 - 36 32 #define ACPI_THERMAL_CLASS "thermal_zone" 37 33 #define ACPI_THERMAL_DEVICE_NAME "Thermal Zone" 38 34 #define ACPI_THERMAL_NOTIFY_TEMPERATURE 0x80 ··· 42 42 43 43 #define ACPI_THERMAL_MAX_ACTIVE 10 44 44 #define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65 45 - 46 - #define _COMPONENT ACPI_THERMAL_COMPONENT 47 - ACPI_MODULE_NAME("thermal"); 48 45 49 46 MODULE_AUTHOR("Paul Diefenbaugh"); 50 47 MODULE_DESCRIPTION("ACPI Thermal Zone Driver"); ··· 194 197 return -ENODEV; 195 198 196 199 tz->temperature = tmp; 197 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %lu dK\n", 198 - tz->temperature)); 200 + 201 + acpi_handle_debug(tz->device->handle, "Temperature is %lu dK\n", 202 + tz->temperature); 199 203 200 204 return 0; 201 205 } ··· 214 216 return -ENODEV; 215 217 216 218 tz->polling_frequency = tmp; 217 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Polling frequency is %lu dS\n", 218 - tz->polling_frequency)); 219 + acpi_handle_debug(tz->device->handle, "Polling frequency is %lu dS\n", 220 + tz->polling_frequency); 219 221 220 222 return 0; 221 223 } ··· 252 254 * 2.TODO: Devices listed in _PSL, _ALx, _TZD may change. 253 255 * We need to re-bind the cooling devices of a thermal zone when this occurs. 254 256 */ 255 - #define ACPI_THERMAL_TRIPS_EXCEPTION(flags, str) \ 257 + #define ACPI_THERMAL_TRIPS_EXCEPTION(flags, tz, str) \ 256 258 do { \ 257 259 if (flags != ACPI_TRIPS_INIT) \ 258 - ACPI_EXCEPTION((AE_INFO, AE_ERROR, \ 260 + acpi_handle_info(tz->device->handle, \ 259 261 "ACPI thermal trip point %s changed\n" \ 260 - "Please send acpidump to linux-acpi@vger.kernel.org", str)); \ 262 + "Please report to linux-acpi@vger.kernel.org\n", str); \ 261 263 } while (0) 262 264 263 265 static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) ··· 281 283 */ 282 284 if (ACPI_FAILURE(status)) { 283 285 tz->trips.critical.flags.valid = 0; 284 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 285 - "No critical threshold\n")); 286 + acpi_handle_debug(tz->device->handle, 287 + "No critical threshold\n"); 286 288 } else if (tmp <= 2732) { 287 - pr_warn(FW_BUG "Invalid critical threshold (%llu)\n", 289 + pr_info(FW_BUG "Invalid critical threshold (%llu)\n", 288 290 tmp); 289 291 tz->trips.critical.flags.valid = 0; 290 292 } else { 291 293 tz->trips.critical.flags.valid = 1; 292 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 294 + acpi_handle_debug(tz->device->handle, 293 295 "Found critical threshold [%lu]\n", 294 - tz->trips.critical.temperature)); 296 + tz->trips.critical.temperature); 295 297 } 296 298 if (tz->trips.critical.flags.valid == 1) { 297 299 if (crt == -1) { ··· 303 305 * Allow override critical threshold 304 306 */ 305 307 if (crt_k > tz->trips.critical.temperature) 306 - pr_warn(PREFIX "Critical threshold %d C\n", 307 - crt); 308 + pr_info("Critical threshold %d C\n", crt); 309 + 308 310 tz->trips.critical.temperature = crt_k; 309 311 } 310 312 } ··· 316 318 "_HOT", NULL, &tmp); 317 319 if (ACPI_FAILURE(status)) { 318 320 tz->trips.hot.flags.valid = 0; 319 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 320 - "No hot threshold\n")); 321 + acpi_handle_debug(tz->device->handle, 322 + "No hot threshold\n"); 321 323 } else { 322 324 tz->trips.hot.temperature = tmp; 323 325 tz->trips.hot.flags.valid = 1; 324 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 325 - "Found hot threshold [%lu]\n", 326 - tz->trips.hot.temperature)); 326 + acpi_handle_debug(tz->device->handle, 327 + "Found hot threshold [%lu]\n", 328 + tz->trips.hot.temperature); 327 329 } 328 330 } 329 331 ··· 376 378 status = acpi_evaluate_reference(tz->device->handle, "_PSL", 377 379 NULL, &devices); 378 380 if (ACPI_FAILURE(status)) { 379 - pr_warn(PREFIX "Invalid passive threshold\n"); 381 + acpi_handle_info(tz->device->handle, 382 + "Invalid passive threshold\n"); 380 383 tz->trips.passive.flags.valid = 0; 381 384 } 382 385 else ··· 387 388 sizeof(struct acpi_handle_list))) { 388 389 memcpy(&tz->trips.passive.devices, &devices, 389 390 sizeof(struct acpi_handle_list)); 390 - ACPI_THERMAL_TRIPS_EXCEPTION(flag, "device"); 391 + ACPI_THERMAL_TRIPS_EXCEPTION(flag, tz, "device"); 391 392 } 392 393 } 393 394 if ((flag & ACPI_TRIPS_PASSIVE) || (flag & ACPI_TRIPS_DEVICES)) { 394 395 if (valid != tz->trips.passive.flags.valid) 395 - ACPI_THERMAL_TRIPS_EXCEPTION(flag, "state"); 396 + ACPI_THERMAL_TRIPS_EXCEPTION(flag, tz, "state"); 396 397 } 397 398 398 399 /* Active (optional) */ ··· 439 440 status = acpi_evaluate_reference(tz->device->handle, 440 441 name, NULL, &devices); 441 442 if (ACPI_FAILURE(status)) { 442 - pr_warn(PREFIX "Invalid active%d threshold\n", 443 - i); 443 + acpi_handle_info(tz->device->handle, 444 + "Invalid active%d threshold\n", i); 444 445 tz->trips.active[i].flags.valid = 0; 445 446 } 446 447 else ··· 450 451 sizeof(struct acpi_handle_list))) { 451 452 memcpy(&tz->trips.active[i].devices, &devices, 452 453 sizeof(struct acpi_handle_list)); 453 - ACPI_THERMAL_TRIPS_EXCEPTION(flag, "device"); 454 + ACPI_THERMAL_TRIPS_EXCEPTION(flag, tz, "device"); 454 455 } 455 456 } 456 457 if ((flag & ACPI_TRIPS_ACTIVE) || (flag & ACPI_TRIPS_DEVICES)) 457 458 if (valid != tz->trips.active[i].flags.valid) 458 - ACPI_THERMAL_TRIPS_EXCEPTION(flag, "state"); 459 + ACPI_THERMAL_TRIPS_EXCEPTION(flag, tz, "state"); 459 460 460 461 if (!tz->trips.active[i].flags.valid) 461 462 break; ··· 468 469 if (ACPI_SUCCESS(status) 469 470 && memcmp(&tz->devices, &devices, sizeof(devices))) { 470 471 tz->devices = devices; 471 - ACPI_THERMAL_TRIPS_EXCEPTION(flag, "device"); 472 + ACPI_THERMAL_TRIPS_EXCEPTION(flag, tz, "device"); 472 473 } 473 474 } 474 475 ··· 924 925 dev_name(&device->dev), event, 0); 925 926 break; 926 927 default: 927 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 928 - "Unsupported event [0x%x]\n", event)); 928 + acpi_handle_debug(device->handle, "Unsupported event [0x%x]\n", 929 + event); 929 930 break; 930 931 } 931 932 } ··· 1073 1074 mutex_init(&tz->thermal_check_lock); 1074 1075 INIT_WORK(&tz->thermal_check_work, acpi_thermal_check_fn); 1075 1076 1076 - pr_info(PREFIX "%s [%s] (%ld C)\n", acpi_device_name(device), 1077 + pr_info("%s [%s] (%ld C)\n", acpi_device_name(device), 1077 1078 acpi_device_bid(device), deci_kelvin_to_celsius(tz->temperature)); 1078 1079 goto end; 1079 1080 ··· 1145 1146 static int thermal_act(const struct dmi_system_id *d) { 1146 1147 1147 1148 if (act == 0) { 1148 - pr_notice(PREFIX "%s detected: " 1149 - "disabling all active thermal trip points\n", d->ident); 1149 + pr_notice("%s detected: disabling all active thermal trip points\n", 1150 + d->ident); 1150 1151 act = -1; 1151 1152 } 1152 1153 return 0; 1153 1154 } 1154 1155 static int thermal_nocrt(const struct dmi_system_id *d) { 1155 1156 1156 - pr_notice(PREFIX "%s detected: " 1157 - "disabling all critical thermal trip point actions.\n", d->ident); 1157 + pr_notice("%s detected: disabling all critical thermal trip point actions.\n", 1158 + d->ident); 1158 1159 nocrt = 1; 1159 1160 return 0; 1160 1161 } 1161 1162 static int thermal_tzp(const struct dmi_system_id *d) { 1162 1163 1163 1164 if (tzp == 0) { 1164 - pr_notice(PREFIX "%s detected: " 1165 - "enabling thermal zone polling\n", d->ident); 1165 + pr_notice("%s detected: enabling thermal zone polling\n", 1166 + d->ident); 1166 1167 tzp = 300; /* 300 dS = 30 Seconds */ 1167 1168 } 1168 1169 return 0; ··· 1170 1171 static int thermal_psv(const struct dmi_system_id *d) { 1171 1172 1172 1173 if (psv == 0) { 1173 - pr_notice(PREFIX "%s detected: " 1174 - "disabling all passive thermal trip points\n", d->ident); 1174 + pr_notice("%s detected: disabling all passive thermal trip points\n", 1175 + d->ident); 1175 1176 psv = -1; 1176 1177 } 1177 1178 return 0; ··· 1224 1225 dmi_check_system(thermal_dmi_table); 1225 1226 1226 1227 if (off) { 1227 - pr_notice(PREFIX "thermal control disabled\n"); 1228 + pr_notice("thermal control disabled\n"); 1228 1229 return -ENODEV; 1229 1230 } 1230 1231
+18 -38
drivers/acpi/utils.c
··· 6 6 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> 7 7 */ 8 8 9 + #define pr_fmt(fmt) "ACPI: utils: " fmt 10 + 9 11 #include <linux/kernel.h> 10 12 #include <linux/module.h> 11 13 #include <linux/slab.h> ··· 20 18 #include "internal.h" 21 19 #include "sleep.h" 22 20 23 - #define _COMPONENT ACPI_BUS_COMPONENT 24 - ACPI_MODULE_NAME("utils"); 25 - 26 21 /* -------------------------------------------------------------------------- 27 22 Object Evaluation Helpers 28 23 -------------------------------------------------------------------------- */ 29 - static void 30 - acpi_util_eval_error(acpi_handle h, acpi_string p, acpi_status s) 24 + static void acpi_util_eval_error(acpi_handle h, acpi_string p, acpi_status s) 31 25 { 32 - #ifdef ACPI_DEBUG_OUTPUT 33 - char prefix[80] = {'\0'}; 34 - struct acpi_buffer buffer = {sizeof(prefix), prefix}; 35 - acpi_get_name(h, ACPI_FULL_PATHNAME, &buffer); 36 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluate [%s.%s]: %s\n", 37 - (char *) prefix, p, acpi_format_exception(s))); 38 - #else 39 - return; 40 - #endif 26 + acpi_handle_debug(h, "Evaluate [%s]: %s\n", p, acpi_format_exception(s)); 41 27 } 42 28 43 29 acpi_status ··· 43 53 44 54 if (!package || (package->type != ACPI_TYPE_PACKAGE) 45 55 || (package->package.count < 1)) { 46 - printk(KERN_WARNING PREFIX "Invalid package argument\n"); 56 + pr_debug("Invalid package argument\n"); 47 57 return AE_BAD_PARAMETER; 48 58 } 49 59 50 60 if (!format || !format->pointer || (format->length < 1)) { 51 - printk(KERN_WARNING PREFIX "Invalid format argument\n"); 61 + pr_debug("Invalid format argument\n"); 52 62 return AE_BAD_PARAMETER; 53 63 } 54 64 55 65 if (!buffer) { 56 - printk(KERN_WARNING PREFIX "Invalid buffer argument\n"); 66 + pr_debug("Invalid buffer argument\n"); 57 67 return AE_BAD_PARAMETER; 58 68 } 59 69 60 70 format_count = (format->length / sizeof(char)) - 1; 61 71 if (format_count > package->package.count) { 62 - printk(KERN_WARNING PREFIX "Format specifies more objects [%d]" 63 - " than exist in package [%d].\n", 64 - format_count, package->package.count); 72 + pr_debug("Format specifies more objects [%d] than present [%d]\n", 73 + format_count, package->package.count); 65 74 return AE_BAD_DATA; 66 75 } 67 76 ··· 88 99 tail_offset += sizeof(char *); 89 100 break; 90 101 default: 91 - printk(KERN_WARNING PREFIX "Invalid package element" 92 - " [%d]: got number, expecting" 93 - " [%c]\n", 94 - i, format_string[i]); 102 + pr_debug("Invalid package element [%d]: got number, expected [%c]\n", 103 + i, format_string[i]); 95 104 return AE_BAD_DATA; 96 105 } 97 106 break; ··· 110 123 tail_offset += sizeof(u8 *); 111 124 break; 112 125 default: 113 - printk(KERN_WARNING PREFIX "Invalid package element" 114 - " [%d] got string/buffer," 115 - " expecting [%c]\n", 116 - i, format_string[i]); 126 + pr_debug("Invalid package element [%d] got string/buffer, expected [%c]\n", 127 + i, format_string[i]); 117 128 return AE_BAD_DATA; 118 129 } 119 130 break; ··· 122 137 tail_offset += sizeof(void *); 123 138 break; 124 139 default: 125 - printk(KERN_WARNING PREFIX "Invalid package element" 126 - " [%d] got reference," 127 - " expecting [%c]\n", 128 - i, format_string[i]); 140 + pr_debug("Invalid package element [%d] got reference, expected [%c]\n", 141 + i, format_string[i]); 129 142 return AE_BAD_DATA; 130 143 } 131 144 break; 132 145 133 146 case ACPI_TYPE_PACKAGE: 134 147 default: 135 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 136 - "Found unsupported element at index=%d\n", 137 - i)); 148 + pr_debug("Unsupported element at index=%d\n", i); 138 149 /* TBD: handle nested packages... */ 139 150 return AE_SUPPORT; 140 151 } ··· 270 289 271 290 *data = element.integer.value; 272 291 273 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%llu]\n", *data)); 292 + acpi_handle_debug(handle, "Return value [%llu]\n", *data); 274 293 275 294 return AE_OK; 276 295 } ··· 344 363 /* Get the acpi_handle. */ 345 364 346 365 list->handles[i] = element->reference.handle; 347 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found reference [%p]\n", 348 - list->handles[i])); 366 + acpi_handle_debug(list->handles[i], "Found in reference list\n"); 349 367 } 350 368 351 369 end:
-7
include/acpi/acpi_drivers.h
··· 15 15 * Please update drivers/acpi/debug.c and Documentation/firmware-guide/acpi/debug.rst 16 16 * if you add to this list. 17 17 */ 18 - #define ACPI_BUS_COMPONENT 0x00010000 19 - #define ACPI_AC_COMPONENT 0x00020000 20 - #define ACPI_BATTERY_COMPONENT 0x00040000 21 - #define ACPI_BUTTON_COMPONENT 0x00080000 22 18 #define ACPI_SBS_COMPONENT 0x00100000 23 19 #define ACPI_FAN_COMPONENT 0x00200000 24 20 #define ACPI_PCI_COMPONENT 0x00400000 25 - #define ACPI_POWER_COMPONENT 0x00800000 26 21 #define ACPI_CONTAINER_COMPONENT 0x01000000 27 22 #define ACPI_SYSTEM_COMPONENT 0x02000000 28 - #define ACPI_THERMAL_COMPONENT 0x04000000 29 23 #define ACPI_MEMORY_DEVICE_COMPONENT 0x08000000 30 - #define ACPI_VIDEO_COMPONENT 0x10000000 31 24 #define ACPI_PROCESSOR_COMPONENT 0x20000000 32 25 33 26 /*