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

Configure Feed

Select the types of activity you want to include in your feed.

Merge back updates of core ACPI drivers for 7.1

+106 -180
+9 -22
drivers/acpi/ac.c
··· 21 21 #include <linux/acpi.h> 22 22 #include <acpi/battery.h> 23 23 24 - #define ACPI_AC_CLASS "ac_adapter" 25 - #define ACPI_AC_DEVICE_NAME "AC Adapter" 26 24 #define ACPI_AC_FILE_STATE "state" 27 25 #define ACPI_AC_NOTIFY_STATUS 0x80 28 26 #define ACPI_AC_STATUS_OFFLINE 0x00 ··· 31 33 MODULE_DESCRIPTION("ACPI AC Adapter Driver"); 32 34 MODULE_LICENSE("GPL"); 33 35 34 - static int acpi_ac_probe(struct platform_device *pdev); 35 - static void acpi_ac_remove(struct platform_device *pdev); 36 - 37 - static void acpi_ac_notify(acpi_handle handle, u32 event, void *data); 38 - 39 36 static const struct acpi_device_id ac_device_ids[] = { 40 37 {"ACPI0003", 0}, 41 38 {"", 0}, 42 39 }; 43 40 MODULE_DEVICE_TABLE(acpi, ac_device_ids); 44 - 45 - #ifdef CONFIG_PM_SLEEP 46 - static int acpi_ac_resume(struct device *dev); 47 - #endif 48 - static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume); 49 41 50 42 static int ac_sleep_before_get_state_ms; 51 43 static int ac_only; ··· 129 141 msleep(ac_sleep_before_get_state_ms); 130 142 131 143 acpi_ac_get_state(ac); 132 - acpi_bus_generate_netlink_event(adev->pnp.device_class, 133 - dev_name(&adev->dev), event, 134 - (u32) ac->state); 135 - acpi_notifier_call_chain(adev, event, (u32) ac->state); 144 + acpi_bus_generate_netlink_event(ACPI_AC_CLASS, 145 + dev_name(&adev->dev), event, 146 + ac->state); 147 + acpi_notifier_call_chain(ACPI_AC_CLASS, acpi_device_bid(adev), 148 + event, ac->state); 136 149 power_supply_changed(ac->charger); 137 150 } 138 151 } ··· 202 213 return -ENOMEM; 203 214 204 215 ac->device = adev; 205 - strscpy(acpi_device_name(adev), ACPI_AC_DEVICE_NAME); 206 - strscpy(acpi_device_class(adev), ACPI_AC_CLASS); 207 216 208 217 platform_set_drvdata(pdev, ac); 209 218 ··· 223 236 goto err_release_ac; 224 237 } 225 238 226 - pr_info("%s [%s] (%s-line)\n", acpi_device_name(adev), 227 - acpi_device_bid(adev), str_on_off(ac->state)); 239 + pr_info("AC Adapter [%s] (%s-line)\n", acpi_device_bid(adev), 240 + str_on_off(ac->state)); 228 241 229 242 ac->battery_nb.notifier_call = acpi_ac_battery_notify; 230 243 register_acpi_notifier(&ac->battery_nb); ··· 259 272 260 273 return 0; 261 274 } 262 - #else 263 - #define acpi_ac_resume NULL 264 275 #endif 276 + 277 + static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume); 265 278 266 279 static void acpi_ac_remove(struct platform_device *pdev) 267 280 {
-4
drivers/acpi/acpi_memhotplug.c
··· 18 18 19 19 #include "internal.h" 20 20 21 - #define ACPI_MEMORY_DEVICE_CLASS "memory" 22 21 #define ACPI_MEMORY_DEVICE_HID "PNP0C80" 23 - #define ACPI_MEMORY_DEVICE_NAME "Hotplug Mem Device" 24 22 25 23 static const struct acpi_device_id memory_device_ids[] = { 26 24 {ACPI_MEMORY_DEVICE_HID, 0}, ··· 295 297 INIT_LIST_HEAD(&mem_device->res_list); 296 298 mem_device->device = device; 297 299 mem_device->mgid = -1; 298 - sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME); 299 - sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS); 300 300 device->driver_data = mem_device; 301 301 302 302 /* Get the range from the _CRS */
+7 -21
drivers/acpi/acpi_pad.c
··· 23 23 #include <asm/mwait.h> 24 24 #include <xen/xen.h> 25 25 26 - #define ACPI_PROCESSOR_AGGREGATOR_CLASS "acpi_pad" 27 - #define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator" 28 26 #define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80 29 27 30 28 #define ACPI_PROCESSOR_AGGREGATOR_STATUS_SUCCESS 0 ··· 405 407 mutex_unlock(&isolated_cpus_lock); 406 408 } 407 409 408 - static void acpi_pad_notify(acpi_handle handle, u32 event, 409 - void *data) 410 + static void acpi_pad_notify(acpi_handle handle, u32 event, void *data) 410 411 { 411 412 struct acpi_device *adev = data; 412 413 413 414 switch (event) { 414 415 case ACPI_PROCESSOR_AGGREGATOR_NOTIFY: 415 416 acpi_pad_handle_notify(handle); 416 - acpi_bus_generate_netlink_event(adev->pnp.device_class, 417 - dev_name(&adev->dev), event, 0); 417 + acpi_bus_generate_netlink_event("acpi_pad", 418 + dev_name(&adev->dev), event, 0); 418 419 break; 419 420 default: 420 421 pr_warn("Unsupported event [0x%x]\n", event); ··· 424 427 static int acpi_pad_probe(struct platform_device *pdev) 425 428 { 426 429 struct acpi_device *adev = ACPI_COMPANION(&pdev->dev); 427 - acpi_status status; 428 430 429 - strscpy(acpi_device_name(adev), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME); 430 - strscpy(acpi_device_class(adev), ACPI_PROCESSOR_AGGREGATOR_CLASS); 431 - 432 - status = acpi_install_notify_handler(adev->handle, 433 - ACPI_DEVICE_NOTIFY, acpi_pad_notify, adev); 434 - 435 - if (ACPI_FAILURE(status)) 436 - return -ENODEV; 437 - 438 - return 0; 431 + return acpi_dev_install_notify_handler(adev, ACPI_DEVICE_NOTIFY, 432 + acpi_pad_notify, adev); 439 433 } 440 434 441 435 static void acpi_pad_remove(struct platform_device *pdev) 442 436 { 443 - struct acpi_device *adev = ACPI_COMPANION(&pdev->dev); 444 - 445 437 mutex_lock(&isolated_cpus_lock); 446 438 acpi_pad_idle_cpus(0); 447 439 mutex_unlock(&isolated_cpus_lock); 448 440 449 - acpi_remove_notify_handler(adev->handle, 450 - ACPI_DEVICE_NOTIFY, acpi_pad_notify); 441 + acpi_dev_remove_notify_handler(ACPI_COMPANION(&pdev->dev), 442 + ACPI_DEVICE_NOTIFY, acpi_pad_notify); 451 443 } 452 444 453 445 static const struct acpi_device_id pad_device_ids[] = {
-2
drivers/acpi/acpi_processor.c
··· 438 438 } 439 439 440 440 pr->handle = device->handle; 441 - strscpy(acpi_device_name(device), ACPI_PROCESSOR_DEVICE_NAME); 442 - strscpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS); 443 441 device->driver_data = pr; 444 442 445 443 result = acpi_processor_get_info(device);
+46 -54
drivers/acpi/acpi_video.c
··· 30 30 #include <linux/uaccess.h> 31 31 #include <linux/string_choices.h> 32 32 33 - #define ACPI_VIDEO_BUS_NAME "Video Bus" 34 - #define ACPI_VIDEO_DEVICE_NAME "Video Device" 35 - 36 33 #define MAX_NAME_LEN 20 37 34 38 35 MODULE_AUTHOR("Bruno Ducrot"); ··· 1141 1144 return -ENOMEM; 1142 1145 } 1143 1146 1144 - strscpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME); 1145 - strscpy(acpi_device_class(device), ACPI_VIDEO_CLASS); 1146 - 1147 1147 data->device_id = device_id; 1148 1148 data->video = video; 1149 1149 data->dev = device; ··· 1564 1570 break; 1565 1571 } 1566 1572 1567 - if (acpi_notifier_call_chain(device, event, 0)) 1573 + if (acpi_notifier_call_chain(ACPI_VIDEO_CLASS, acpi_device_bid(device), 1574 + event, 0)) 1568 1575 /* Something vetoed the keypress. */ 1569 1576 keycode = 0; 1570 1577 ··· 1606 1611 if (video_device->backlight) 1607 1612 backlight_force_update(video_device->backlight, 1608 1613 BACKLIGHT_UPDATE_HOTKEY); 1609 - acpi_notifier_call_chain(device, event, 0); 1614 + acpi_notifier_call_chain(ACPI_VIDEO_CLASS, acpi_device_bid(device), 1615 + event, 0); 1610 1616 return; 1611 1617 } 1612 1618 ··· 1640 1644 if (keycode) 1641 1645 may_report_brightness_keys = true; 1642 1646 1643 - acpi_notifier_call_chain(device, event, 0); 1647 + acpi_notifier_call_chain(ACPI_VIDEO_CLASS, acpi_device_bid(device), 1648 + event, 0); 1644 1649 1645 1650 if (keycode && (report_key_events & REPORT_BRIGHTNESS_KEY_EVENTS)) { 1646 1651 input_report_key(input, keycode, 1); ··· 1676 1679 return NOTIFY_OK; 1677 1680 } 1678 1681 return NOTIFY_DONE; 1679 - } 1680 - 1681 - static acpi_status 1682 - acpi_video_bus_match(acpi_handle handle, u32 level, void *context, 1683 - void **return_value) 1684 - { 1685 - struct acpi_device *device = context; 1686 - struct acpi_device *sibling; 1687 - 1688 - if (handle == device->handle) 1689 - return AE_CTRL_TERMINATE; 1690 - 1691 - sibling = acpi_fetch_acpi_dev(handle); 1692 - if (!sibling) 1693 - return AE_OK; 1694 - 1695 - if (!strcmp(acpi_device_name(sibling), ACPI_VIDEO_BUS_NAME)) 1696 - return AE_ALREADY_EXISTS; 1697 - 1698 - return AE_OK; 1699 1682 } 1700 1683 1701 1684 static void acpi_video_dev_register_backlight(struct acpi_video_device *device) ··· 1879 1902 snprintf(video->phys, sizeof(video->phys), 1880 1903 "%s/video/input0", acpi_device_hid(video->device)); 1881 1904 1882 - input->name = acpi_device_name(video->device); 1905 + input->name = "Video Bus"; 1883 1906 input->phys = video->phys; 1884 1907 input->id.bustype = BUS_HOST; 1885 1908 input->id.product = 0x06; ··· 1953 1976 return 0; 1954 1977 } 1955 1978 1956 - static int instance; 1979 + static int duplicate_dev_check(struct device *sibling, void *data) 1980 + { 1981 + struct acpi_video_bus *video; 1982 + 1983 + if (sibling == data || !dev_is_auxiliary(sibling)) 1984 + return 0; 1985 + 1986 + guard(mutex)(&video_list_lock); 1987 + 1988 + list_for_each_entry(video, &video_bus_head, entry) { 1989 + if (video == dev_get_drvdata(sibling)) 1990 + return -EEXIST; 1991 + } 1992 + 1993 + return 0; 1994 + } 1995 + 1996 + static bool acpi_video_bus_dev_is_duplicate(struct device *dev) 1997 + { 1998 + return device_for_each_child(dev->parent, dev, duplicate_dev_check); 1999 + } 1957 2000 1958 2001 static int acpi_video_bus_probe(struct auxiliary_device *aux_dev, 1959 2002 const struct auxiliary_device_id *id_unused) 1960 2003 { 1961 2004 struct acpi_device *device = ACPI_COMPANION(&aux_dev->dev); 2005 + static DEFINE_MUTEX(probe_lock); 1962 2006 struct acpi_video_bus *video; 2007 + static int instance; 1963 2008 bool auto_detect; 1964 2009 int error; 1965 - acpi_status status; 1966 2010 1967 - status = acpi_walk_namespace(ACPI_TYPE_DEVICE, 1968 - acpi_dev_parent(device)->handle, 1, 1969 - acpi_video_bus_match, NULL, 1970 - device, NULL); 1971 - if (status == AE_ALREADY_EXISTS) { 2011 + /* Probe one video bus device at a time in case there are duplicates. */ 2012 + guard(mutex)(&probe_lock); 2013 + 2014 + if (!allow_duplicates && acpi_video_bus_dev_is_duplicate(&aux_dev->dev)) { 1972 2015 pr_info(FW_BUG 1973 2016 "Duplicate ACPI video bus devices for the" 1974 2017 " same VGA controller, please try module " 1975 2018 "parameter \"video.allow_duplicates=1\"" 1976 2019 "if the current driver doesn't work.\n"); 1977 - if (!allow_duplicates) 1978 - return -ENODEV; 2020 + return -ENODEV; 1979 2021 } 1980 2022 1981 2023 video = kzalloc_obj(struct acpi_video_bus); 1982 2024 if (!video) 1983 2025 return -ENOMEM; 1984 2026 1985 - /* a hack to fix the duplicate name "VID" problem on T61 */ 1986 - if (!strcmp(device->pnp.bus_id, "VID")) { 2027 + /* 2028 + * A hack to fix the duplicate name "VID" problem on T61 and the 2029 + * duplicate name "VGA" problem on Pa 3553. 2030 + */ 2031 + if (!strcmp(device->pnp.bus_id, "VID") || 2032 + !strcmp(device->pnp.bus_id, "VGA")) { 1987 2033 if (instance) 1988 2034 device->pnp.bus_id[3] = '0' + instance; 1989 - instance++; 1990 - } 1991 - /* a hack to fix the duplicate name "VGA" problem on Pa 3553 */ 1992 - if (!strcmp(device->pnp.bus_id, "VGA")) { 1993 - if (instance) 1994 - device->pnp.bus_id[3] = '0' + instance; 2035 + 1995 2036 instance++; 1996 2037 } 1997 2038 1998 2039 auxiliary_set_drvdata(aux_dev, video); 1999 2040 2000 2041 video->device = device; 2001 - strscpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME); 2002 - strscpy(acpi_device_class(device), ACPI_VIDEO_CLASS); 2003 2042 device->driver_data = video; 2004 2043 2005 2044 acpi_video_bus_find_cap(video); ··· 2036 2043 */ 2037 2044 acpi_device_fix_up_power_children(device); 2038 2045 2039 - pr_info("%s [%s] (multi-head: %s rom: %s post: %s)\n", 2040 - ACPI_VIDEO_DEVICE_NAME, acpi_device_bid(device), 2041 - str_yes_no(video->flags.multihead), 2042 - str_yes_no(video->flags.rom), 2043 - str_yes_no(video->flags.post)); 2046 + pr_info("Video Device [%s] (multi-head: %s rom: %s post: %s)\n", 2047 + acpi_device_bid(device), str_yes_no(video->flags.multihead), 2048 + str_yes_no(video->flags.rom), str_yes_no(video->flags.post)); 2049 + 2044 2050 mutex_lock(&video_list_lock); 2045 2051 list_add_tail(&video->entry, &video_bus_head); 2046 2052 mutex_unlock(&video_list_lock);
+3 -6
drivers/acpi/battery.c
··· 33 33 #define ACPI_BATTERY_CAPACITY_VALID(capacity) \ 34 34 ((capacity) != 0 && (capacity) != ACPI_BATTERY_VALUE_UNKNOWN) 35 35 36 - #define ACPI_BATTERY_DEVICE_NAME "Battery" 37 - 38 36 /* Battery power unit: 0 means mW, 1 means mA */ 39 37 #define ACPI_BATTERY_POWER_UNIT_MA 1 40 38 ··· 1078 1080 if (event == ACPI_BATTERY_NOTIFY_INFO) 1079 1081 acpi_battery_refresh(battery); 1080 1082 acpi_battery_update(battery, false); 1081 - acpi_bus_generate_netlink_event(device->pnp.device_class, 1083 + acpi_bus_generate_netlink_event(ACPI_BATTERY_CLASS, 1082 1084 dev_name(&device->dev), event, 1083 1085 acpi_battery_present(battery)); 1084 - acpi_notifier_call_chain(device, event, acpi_battery_present(battery)); 1086 + acpi_notifier_call_chain(ACPI_BATTERY_CLASS, acpi_device_bid(device), 1087 + event, acpi_battery_present(battery)); 1085 1088 /* acpi_battery_update could remove power_supply object */ 1086 1089 if (old && battery->bat) 1087 1090 power_supply_changed(battery->bat); ··· 1228 1229 platform_set_drvdata(pdev, battery); 1229 1230 1230 1231 battery->device = device; 1231 - strscpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME); 1232 - strscpy(acpi_device_class(device), ACPI_BATTERY_CLASS); 1233 1232 1234 1233 result = devm_mutex_init(&pdev->dev, &battery->update_lock); 1235 1234 if (result)
+6 -5
drivers/acpi/button.c
··· 468 468 input_report_key(input, keycode, 0); 469 469 input_sync(input); 470 470 471 - acpi_bus_generate_netlink_event(device->pnp.device_class, 471 + acpi_bus_generate_netlink_event(acpi_device_class(device), 472 472 dev_name(&device->dev), 473 473 event, ++button->pushed); 474 474 } ··· 558 558 goto err_free_button; 559 559 } 560 560 561 - name = acpi_device_name(device); 562 561 class = acpi_device_class(device); 563 562 564 563 if (!strcmp(hid, ACPI_BUTTON_HID_POWER) || 565 564 !strcmp(hid, ACPI_BUTTON_HID_POWERF)) { 566 565 button->type = ACPI_BUTTON_TYPE_POWER; 567 566 handler = acpi_button_notify; 568 - strscpy(name, ACPI_BUTTON_DEVICE_NAME_POWER, MAX_ACPI_DEVICE_NAME_LEN); 567 + name = ACPI_BUTTON_DEVICE_NAME_POWER; 569 568 sprintf(class, "%s/%s", 570 569 ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER); 571 570 } else if (!strcmp(hid, ACPI_BUTTON_HID_SLEEP) || 572 571 !strcmp(hid, ACPI_BUTTON_HID_SLEEPF)) { 573 572 button->type = ACPI_BUTTON_TYPE_SLEEP; 574 573 handler = acpi_button_notify; 575 - strscpy(name, ACPI_BUTTON_DEVICE_NAME_SLEEP, MAX_ACPI_DEVICE_NAME_LEN); 574 + name = ACPI_BUTTON_DEVICE_NAME_SLEEP; 576 575 sprintf(class, "%s/%s", 577 576 ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP); 578 577 } else if (!strcmp(hid, ACPI_BUTTON_HID_LID)) { 579 578 button->type = ACPI_BUTTON_TYPE_LID; 580 579 handler = acpi_lid_notify; 581 - strscpy(name, ACPI_BUTTON_DEVICE_NAME_LID, MAX_ACPI_DEVICE_NAME_LEN); 580 + name = ACPI_BUTTON_DEVICE_NAME_LID; 582 581 sprintf(class, "%s/%s", 583 582 ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID); 584 583 input->open = acpi_lid_input_open; ··· 697 698 acpi_button_remove_fs(button); 698 699 input_unregister_device(button->input); 699 700 kfree(button); 701 + 702 + memset(acpi_device_class(adev), 0, sizeof(acpi_device_class)); 700 703 } 701 704 702 705 static int param_set_lid_init_state(const char *val,
-6
drivers/acpi/ec.c
··· 35 35 36 36 #include "internal.h" 37 37 38 - #define ACPI_EC_CLASS "embedded_controller" 39 - #define ACPI_EC_DEVICE_NAME "Embedded Controller" 40 - 41 38 /* EC status register */ 42 39 #define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */ 43 40 #define ACPI_EC_FLAG_IBF 0x02 /* Input buffer full */ ··· 1677 1680 struct acpi_device *device = ACPI_COMPANION(&pdev->dev); 1678 1681 struct acpi_ec *ec; 1679 1682 int ret; 1680 - 1681 - strscpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME); 1682 - strscpy(acpi_device_class(device), ACPI_EC_CLASS); 1683 1683 1684 1684 if (boot_ec && (boot_ec->handle == device->handle || 1685 1685 !strcmp(acpi_device_hid(device), ACPI_ECDT_HID))) {
+4 -3
drivers/acpi/event.c
··· 24 24 /* ACPI notifier chain */ 25 25 static BLOCKING_NOTIFIER_HEAD(acpi_chain_head); 26 26 27 - int acpi_notifier_call_chain(struct acpi_device *dev, u32 type, u32 data) 27 + int acpi_notifier_call_chain(const char *device_class, 28 + const char *bus_id, u32 type, u32 data) 28 29 { 29 30 struct acpi_bus_event event; 30 31 31 - strscpy(event.device_class, dev->pnp.device_class); 32 - strscpy(event.bus_id, dev->pnp.bus_id); 32 + strscpy(event.device_class, device_class); 33 + strscpy(event.bus_id, bus_id); 33 34 event.type = type; 34 35 event.data = data; 35 36 return (blocking_notifier_call_chain(&acpi_chain_head, 0, (void *)&event)
-4
drivers/acpi/pci_link.c
··· 29 29 30 30 #include "internal.h" 31 31 32 - #define ACPI_PCI_LINK_CLASS "pci_irq_routing" 33 - #define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link" 34 32 #define ACPI_PCI_LINK_MAX_POSSIBLE 16 35 33 36 34 static int acpi_pci_link_add(struct acpi_device *device, ··· 723 725 return -ENOMEM; 724 726 725 727 link->device = device; 726 - strscpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME); 727 - strscpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS); 728 728 device->driver_data = link; 729 729 730 730 mutex_lock(&acpi_link_lock);
+2 -7
drivers/acpi/pci_root.c
··· 24 24 #include <linux/platform_data/x86/apple.h> 25 25 #include "internal.h" 26 26 27 - #define ACPI_PCI_ROOT_CLASS "pci_bridge" 28 - #define ACPI_PCI_ROOT_DEVICE_NAME "PCI Root Bridge" 29 27 static int acpi_pci_root_add(struct acpi_device *device, 30 28 const struct acpi_device_id *not_used); 31 29 static void acpi_pci_root_remove(struct acpi_device *device); ··· 687 689 688 690 root->device = device; 689 691 root->segment = segment & 0xFFFF; 690 - strscpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME); 691 - strscpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); 692 692 device->driver_data = root; 693 693 694 694 if (hotadd && dmar_device_add(handle)) { ··· 694 698 goto end; 695 699 } 696 700 697 - pr_info("%s [%s] (domain %04x %pR)\n", 698 - acpi_device_name(device), acpi_device_bid(device), 699 - root->segment, &root->secondary); 701 + pr_info("PCI Root Bridge [%s] (domain %04x %pR)\n", 702 + acpi_device_bid(device), root->segment, &root->secondary); 700 703 701 704 root->mcfg_addr = acpi_pci_root_get_mcfg_addr(handle); 702 705
-4
drivers/acpi/power.c
··· 37 37 #include "sleep.h" 38 38 #include "internal.h" 39 39 40 - #define ACPI_POWER_CLASS "power_resource" 41 - #define ACPI_POWER_DEVICE_NAME "Power Resource" 42 40 #define ACPI_POWER_RESOURCE_STATE_OFF 0x00 43 41 #define ACPI_POWER_RESOURCE_STATE_ON 0x01 44 42 #define ACPI_POWER_RESOURCE_STATE_UNKNOWN 0xFF ··· 953 955 mutex_init(&resource->resource_lock); 954 956 INIT_LIST_HEAD(&resource->list_node); 955 957 INIT_LIST_HEAD(&resource->dependents); 956 - strscpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); 957 - strscpy(acpi_device_class(device), ACPI_POWER_CLASS); 958 958 device->power.state = ACPI_STATE_UNKNOWN; 959 959 device->flags.match_driver = true; 960 960
+8 -14
drivers/acpi/processor_driver.c
··· 53 53 { 54 54 struct acpi_device *device = data; 55 55 struct acpi_processor *pr; 56 - int saved; 56 + int saved, ev_data = 0; 57 57 58 58 if (device->handle != handle) 59 59 return; ··· 66 66 case ACPI_PROCESSOR_NOTIFY_PERFORMANCE: 67 67 saved = pr->performance_platform_limit; 68 68 acpi_processor_ppc_has_changed(pr, 1); 69 - if (saved == pr->performance_platform_limit) 70 - break; 71 - acpi_bus_generate_netlink_event(device->pnp.device_class, 72 - dev_name(&device->dev), event, 73 - pr->performance_platform_limit); 69 + ev_data = pr->performance_platform_limit; 70 + if (saved == ev_data) 71 + return; 72 + 74 73 break; 75 74 case ACPI_PROCESSOR_NOTIFY_POWER: 76 75 acpi_processor_power_state_has_changed(pr); 77 - acpi_bus_generate_netlink_event(device->pnp.device_class, 78 - dev_name(&device->dev), event, 0); 79 76 break; 80 77 case ACPI_PROCESSOR_NOTIFY_THROTTLING: 81 78 acpi_processor_tstate_has_changed(pr); 82 - acpi_bus_generate_netlink_event(device->pnp.device_class, 83 - dev_name(&device->dev), event, 0); 84 79 break; 85 80 case ACPI_PROCESSOR_NOTIFY_HIGEST_PERF_CHANGED: 86 81 cpufreq_update_limits(pr->id); 87 - acpi_bus_generate_netlink_event(device->pnp.device_class, 88 - dev_name(&device->dev), event, 0); 89 82 break; 90 83 default: 91 84 acpi_handle_debug(handle, "Unsupported event [0x%x]\n", event); 92 - break; 85 + return; 93 86 } 94 87 95 - return; 88 + acpi_bus_generate_netlink_event("processor", dev_name(&device->dev), 89 + event, ev_data); 96 90 } 97 91 98 92 static int __acpi_processor_start(struct acpi_device *device);
-4
drivers/acpi/sbs.c
··· 26 26 27 27 #include "sbshc.h" 28 28 29 - #define ACPI_SBS_CLASS "sbs" 30 - #define ACPI_AC_CLASS "ac_adapter" 31 29 #define ACPI_SBS_DEVICE_NAME "Smart Battery System" 32 30 #define ACPI_BATTERY_DIR_NAME "BAT%i" 33 31 #define ACPI_AC_DIR_NAME "AC0" ··· 646 648 647 649 sbs->hc = dev_get_drvdata(pdev->dev.parent); 648 650 sbs->device = device; 649 - strscpy(acpi_device_name(device), ACPI_SBS_DEVICE_NAME); 650 - strscpy(acpi_device_class(device), ACPI_SBS_CLASS); 651 651 652 652 result = acpi_charger_add(sbs); 653 653 if (result && result != -ENODEV)
-6
drivers/acpi/sbshc.c
··· 18 18 #include "sbshc.h" 19 19 #include "internal.h" 20 20 21 - #define ACPI_SMB_HC_CLASS "smbus_host_ctl" 22 - #define ACPI_SMB_HC_DEVICE_NAME "ACPI SMBus HC" 23 - 24 21 struct acpi_smb_hc { 25 22 struct acpi_ec *ec; 26 23 struct mutex lock; ··· 247 250 pr_err("error obtaining _EC.\n"); 248 251 return -EIO; 249 252 } 250 - 251 - strscpy(acpi_device_name(device), ACPI_SMB_HC_DEVICE_NAME); 252 - strscpy(acpi_device_class(device), ACPI_SMB_HC_CLASS); 253 253 254 254 hc = kzalloc_obj(struct acpi_smb_hc); 255 255 if (!hc)
+5 -8
drivers/acpi/thermal.c
··· 35 35 #include "internal.h" 36 36 37 37 #define ACPI_THERMAL_CLASS "thermal_zone" 38 - #define ACPI_THERMAL_DEVICE_NAME "Thermal Zone" 39 38 #define ACPI_THERMAL_NOTIFY_TEMPERATURE 0x80 40 39 #define ACPI_THERMAL_NOTIFY_THRESHOLDS 0x81 41 40 #define ACPI_THERMAL_NOTIFY_DEVICES 0x82 ··· 340 341 thermal_zone_for_each_trip(tz->thermal_zone, 341 342 acpi_thermal_adjust_trip, &atd); 342 343 acpi_queue_thermal_check(tz); 343 - acpi_bus_generate_netlink_event(adev->pnp.device_class, 344 + acpi_bus_generate_netlink_event(ACPI_THERMAL_CLASS, 344 345 dev_name(&adev->dev), event, 0); 345 346 } 346 347 ··· 542 543 { 543 544 struct acpi_thermal *tz = thermal_zone_device_priv(thermal); 544 545 545 - acpi_bus_generate_netlink_event(tz->device->pnp.device_class, 546 + acpi_bus_generate_netlink_event(ACPI_THERMAL_CLASS, 546 547 dev_name(&tz->device->dev), 547 548 ACPI_THERMAL_NOTIFY_HOT, 1); 548 549 } ··· 551 552 { 552 553 struct acpi_thermal *tz = thermal_zone_device_priv(thermal); 553 554 554 - acpi_bus_generate_netlink_event(tz->device->pnp.device_class, 555 + acpi_bus_generate_netlink_event(ACPI_THERMAL_CLASS, 555 556 dev_name(&tz->device->dev), 556 557 ACPI_THERMAL_NOTIFY_CRITICAL, 1); 557 558 ··· 799 800 800 801 tz->device = device; 801 802 strscpy(tz->name, device->pnp.bus_id); 802 - strscpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME); 803 - strscpy(acpi_device_class(device), ACPI_THERMAL_CLASS); 804 803 805 804 acpi_thermal_aml_dependency_fix(tz); 806 805 ··· 876 879 mutex_init(&tz->thermal_check_lock); 877 880 INIT_WORK(&tz->thermal_check_work, acpi_thermal_check_fn); 878 881 879 - pr_info("%s [%s] (%ld C)\n", acpi_device_name(device), 880 - acpi_device_bid(device), deci_kelvin_to_celsius(tz->temp_dk)); 882 + pr_info("Thermal Zone [%s] (%ld C)\n", acpi_device_bid(device), 883 + deci_kelvin_to_celsius(tz->temp_dk)); 881 884 882 885 result = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY, 883 886 acpi_thermal_notify, tz);
+10
drivers/base/auxiliary.c
··· 502 502 } 503 503 EXPORT_SYMBOL_GPL(__devm_auxiliary_device_create); 504 504 505 + /** 506 + * dev_is_auxiliary - check if the device is an auxiliary one 507 + * @dev: device to check 508 + */ 509 + bool dev_is_auxiliary(struct device *dev) 510 + { 511 + return dev->bus == &auxiliary_bus_type; 512 + } 513 + EXPORT_SYMBOL_GPL(dev_is_auxiliary); 514 + 505 515 void __init auxiliary_bus_init(void) 506 516 { 507 517 WARN_ON(bus_register(&auxiliary_bus_type));
-2
drivers/gpu/drm/amd/include/amd_acpi.h
··· 26 26 27 27 #include <linux/types.h> 28 28 29 - #define ACPI_AC_CLASS "ac_adapter" 30 - 31 29 struct atif_verify_interface { 32 30 u16 size; /* structure size in bytes (includes size field) */ 33 31 u16 version; /* version */
-2
drivers/gpu/drm/radeon/radeon_acpi.c
··· 44 44 static inline bool radeon_atpx_dgpu_req_power_for_displays(void) { return false; } 45 45 #endif 46 46 47 - #define ACPI_AC_CLASS "ac_adapter" 48 - 49 47 struct atif_verify_interface { 50 48 u16 size; /* structure size in bytes (includes size field) */ 51 49 u16 version; /* version */
-2
drivers/platform/x86/hp/hp-wmi.c
··· 58 58 #define HP_POWER_LIMIT_DEFAULT 0x00 59 59 #define HP_POWER_LIMIT_NO_CHANGE 0xFF 60 60 61 - #define ACPI_AC_CLASS "ac_adapter" 62 - 63 61 #define zero_if_sup(tmp) (zero_insize_support?0:sizeof(tmp)) // use when zero insize is required 64 62 65 63 enum hp_thermal_profile_omen_v0 {
-1
drivers/platform/x86/lenovo/wmi-capdata.c
··· 53 53 #define LENOVO_CAPABILITY_DATA_01_GUID "7A8F5407-CB67-4D6E-B547-39B3BE018154" 54 54 #define LENOVO_FAN_TEST_DATA_GUID "B642801B-3D21-45DE-90AE-6E86F164FB21" 55 55 56 - #define ACPI_AC_CLASS "ac_adapter" 57 56 #define ACPI_AC_NOTIFY_STATUS 0x80 58 57 59 58 #define LWMI_FEATURE_ID_FAN_TEST 0x05
+4 -1
include/acpi/acpi_bus.h
··· 613 613 u32 data; 614 614 }; 615 615 616 + #define ACPI_AC_CLASS "ac_adapter" 617 + 616 618 extern struct kobject *acpi_kobj; 617 619 extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); 618 620 void acpi_bus_private_data_handler(acpi_handle, void *); ··· 627 625 void acpi_dev_remove_notify_handler(struct acpi_device *adev, 628 626 u32 handler_type, 629 627 acpi_notify_handler handler); 630 - extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32); 628 + extern int acpi_notifier_call_chain(const char *device_class, 629 + const char *bus_id, u32 type, u32 data); 631 630 extern int register_acpi_notifier(struct notifier_block *); 632 631 extern int unregister_acpi_notifier(struct notifier_block *); 633 632
-2
include/acpi/processor.h
··· 14 14 15 15 #include <asm/acpi.h> 16 16 17 - #define ACPI_PROCESSOR_CLASS "processor" 18 - #define ACPI_PROCESSOR_DEVICE_NAME "Processor" 19 17 #define ACPI_PROCESSOR_DEVICE_HID "ACPI0007" 20 18 #define ACPI_PROCESSOR_CONTAINER_HID "ACPI0010" 21 19
+2
include/linux/auxiliary_bus.h
··· 271 271 __devm_auxiliary_device_create(dev, KBUILD_MODNAME, devname, \ 272 272 platform_data, 0) 273 273 274 + bool dev_is_auxiliary(struct device *dev); 275 + 274 276 /** 275 277 * module_auxiliary_driver() - Helper macro for registering an auxiliary driver 276 278 * @__auxiliary_driver: auxiliary driver struct