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 branches 'bugzilla-25412' and 'bugzilla-25302' into release

Len Brown bbbcde9d d7c1255a

+63 -42
+3
drivers/acpi/acpica/evgpeinit.c
··· 408 408 return_ACPI_STATUS(AE_OK); 409 409 } 410 410 411 + /* Disable the GPE in case it's been enabled already. */ 412 + (void)acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_DISABLE); 413 + 411 414 /* 412 415 * Add the GPE information from above to the gpe_event_info block for 413 416 * use during dispatch of this GPE.
-5
drivers/acpi/battery.c
··· 130 130 unsigned long flags; 131 131 }; 132 132 133 - static int acpi_battery_update(struct acpi_battery *battery); 134 - 135 133 #define to_acpi_battery(x) container_of(x, struct acpi_battery, bat); 136 134 137 135 inline int acpi_battery_present(struct acpi_battery *battery) ··· 183 185 { 184 186 int ret = 0; 185 187 struct acpi_battery *battery = to_acpi_battery(psy); 186 - 187 - if (acpi_battery_update(battery)) 188 - return -ENODEV; 189 188 190 189 if (acpi_battery_present(battery)) { 191 190 /* run battery update only if it is present */
+60 -37
drivers/acpi/scan.c
··· 705 705 } 706 706 707 707 static acpi_status 708 - acpi_bus_extract_wakeup_device_power_package(struct acpi_device *device, 709 - union acpi_object *package) 708 + acpi_bus_extract_wakeup_device_power_package(acpi_handle handle, 709 + struct acpi_device_wakeup *wakeup) 710 710 { 711 - int i = 0; 711 + struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 712 + union acpi_object *package = NULL; 712 713 union acpi_object *element = NULL; 714 + acpi_status status; 715 + int i = 0; 713 716 714 - if (!device || !package || (package->package.count < 2)) 717 + if (!wakeup) 715 718 return AE_BAD_PARAMETER; 719 + 720 + /* _PRW */ 721 + status = acpi_evaluate_object(handle, "_PRW", NULL, &buffer); 722 + if (ACPI_FAILURE(status)) { 723 + ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRW")); 724 + return status; 725 + } 726 + 727 + package = (union acpi_object *)buffer.pointer; 728 + 729 + if (!package || (package->package.count < 2)) { 730 + status = AE_BAD_DATA; 731 + goto out; 732 + } 716 733 717 734 element = &(package->package.elements[0]); 718 - if (!element) 719 - return AE_BAD_PARAMETER; 735 + if (!element) { 736 + status = AE_BAD_DATA; 737 + goto out; 738 + } 720 739 if (element->type == ACPI_TYPE_PACKAGE) { 721 740 if ((element->package.count < 2) || 722 741 (element->package.elements[0].type != 723 742 ACPI_TYPE_LOCAL_REFERENCE) 724 - || (element->package.elements[1].type != ACPI_TYPE_INTEGER)) 725 - return AE_BAD_DATA; 726 - device->wakeup.gpe_device = 743 + || (element->package.elements[1].type != ACPI_TYPE_INTEGER)) { 744 + status = AE_BAD_DATA; 745 + goto out; 746 + } 747 + wakeup->gpe_device = 727 748 element->package.elements[0].reference.handle; 728 - device->wakeup.gpe_number = 749 + wakeup->gpe_number = 729 750 (u32) element->package.elements[1].integer.value; 730 751 } else if (element->type == ACPI_TYPE_INTEGER) { 731 - device->wakeup.gpe_number = element->integer.value; 732 - } else 733 - return AE_BAD_DATA; 752 + wakeup->gpe_device = NULL; 753 + wakeup->gpe_number = element->integer.value; 754 + } else { 755 + status = AE_BAD_DATA; 756 + goto out; 757 + } 734 758 735 759 element = &(package->package.elements[1]); 736 760 if (element->type != ACPI_TYPE_INTEGER) { 737 - return AE_BAD_DATA; 761 + status = AE_BAD_DATA; 762 + goto out; 738 763 } 739 - device->wakeup.sleep_state = element->integer.value; 764 + wakeup->sleep_state = element->integer.value; 740 765 741 766 if ((package->package.count - 2) > ACPI_MAX_HANDLES) { 742 - return AE_NO_MEMORY; 767 + status = AE_NO_MEMORY; 768 + goto out; 743 769 } 744 - device->wakeup.resources.count = package->package.count - 2; 745 - for (i = 0; i < device->wakeup.resources.count; i++) { 770 + wakeup->resources.count = package->package.count - 2; 771 + for (i = 0; i < wakeup->resources.count; i++) { 746 772 element = &(package->package.elements[i + 2]); 747 - if (element->type != ACPI_TYPE_LOCAL_REFERENCE) 748 - return AE_BAD_DATA; 773 + if (element->type != ACPI_TYPE_LOCAL_REFERENCE) { 774 + status = AE_BAD_DATA; 775 + goto out; 776 + } 749 777 750 - device->wakeup.resources.handles[i] = element->reference.handle; 778 + wakeup->resources.handles[i] = element->reference.handle; 751 779 } 752 780 753 - acpi_gpe_can_wake(device->wakeup.gpe_device, device->wakeup.gpe_number); 781 + acpi_gpe_can_wake(wakeup->gpe_device, wakeup->gpe_number); 754 782 755 - return AE_OK; 783 + out: 784 + kfree(buffer.pointer); 785 + 786 + return status; 756 787 } 757 788 758 789 static void acpi_bus_set_run_wake_flags(struct acpi_device *device) ··· 818 787 static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device) 819 788 { 820 789 acpi_status status = 0; 821 - struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 822 - union acpi_object *package = NULL; 823 790 int psw_error; 824 791 825 - /* _PRW */ 826 - status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer); 827 - if (ACPI_FAILURE(status)) { 828 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRW")); 829 - goto end; 830 - } 831 - 832 - package = (union acpi_object *)buffer.pointer; 833 - status = acpi_bus_extract_wakeup_device_power_package(device, package); 792 + status = acpi_bus_extract_wakeup_device_power_package(device->handle, 793 + &device->wakeup); 834 794 if (ACPI_FAILURE(status)) { 835 795 ACPI_EXCEPTION((AE_INFO, status, "Extracting _PRW package")); 836 796 goto end; 837 797 } 838 - 839 - kfree(buffer.pointer); 840 798 841 799 device->wakeup.flags.valid = 1; 842 800 device->wakeup.prepare_count = 0; ··· 1371 1351 struct acpi_bus_ops *ops = context; 1372 1352 int type; 1373 1353 unsigned long long sta; 1354 + struct acpi_device_wakeup wakeup; 1374 1355 struct acpi_device *device; 1375 1356 acpi_status status; 1376 1357 int result; ··· 1381 1360 return AE_OK; 1382 1361 1383 1362 if (!(sta & ACPI_STA_DEVICE_PRESENT) && 1384 - !(sta & ACPI_STA_DEVICE_FUNCTIONING)) 1363 + !(sta & ACPI_STA_DEVICE_FUNCTIONING)) { 1364 + acpi_bus_extract_wakeup_device_power_package(handle, &wakeup); 1385 1365 return AE_CTRL_DEPTH; 1366 + } 1386 1367 1387 1368 /* 1388 1369 * We may already have an acpi_device from a previous enumeration. If