From: Rafael J. Wysocki Date: Fri, 30 Sep 2022 18:28:22 +0000 (+0200) Subject: Merge branches 'acpi-scan', 'acpi-bus' and 'acpi-platform' X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c77f54a9bcecb844db284de1ba0c7dc0c7796510;p=linux.git Merge branches 'acpi-scan', 'acpi-bus' and 'acpi-platform' Merge changes related to ACPI device enumeration and ACPI support for platform devices for 6.1-rc1: - Clean up ACPI platform devices support code (Andy Shevchenko, John Garry). - Clean up ACPI bus management code (Andy Shevchenko, ye xingchen). - Add support for multiple DMA windows with different offsets to the ACPI device enumeration code and use it on LoongArch (Jianmin Lv). * acpi-scan: LoongArch: Use acpi_arch_dma_setup() and remove ARCH_HAS_PHYS_TO_DMA ACPI: scan: Support multiple DMA windows with different offsets * acpi-bus: ACPI: bus: Refactor ACPI matching functions for better readability ACPI: bus: Drop kernel doc annotation from acpi_bus_notify() ACPI: bus: Remove the unneeded result variable * acpi-platform: ACPI: platform: Use PLATFORM_DEVID_NONE in acpi_create_platform_device() ACPI: platform: Sort forbidden_id_list[] in ascending order ACPI: platform: Use sizeof(*pointer) instead of sizeof(type) ACPI: platform: Remove redundant print on -ENOMEM ACPI: platform: Get rid of redundant 'else' --- c77f54a9bcecb844db284de1ba0c7dc0c7796510 diff --cc drivers/acpi/acpi_platform.c index 1a1c78b23fba3,de3cbf152deef,de3cbf152deef,ebd18c716b501..fe00a5783f53f --- a/drivers/acpi/acpi_platform.c +++ b/drivers/acpi/acpi_platform.c @@@@@ -138,9 -137,10 -137,10 -135,10 +136,9 @@@@@ struct platform_device *acpi_create_pla * attached to it, that physical device should be the parent of the * platform device we are about to create. */ --- pdevinfo.parent = adev->parent ? --- acpi_get_first_physical_node(adev->parent) : NULL; +++ pdevinfo.parent = parent ? acpi_get_first_physical_node(parent) : NULL; pdevinfo.name = dev_name(&adev->dev); --- pdevinfo.id = -1; +++ pdevinfo.id = PLATFORM_DEVID_NONE; pdevinfo.res = resources; pdevinfo.num_res = count; pdevinfo.fwnode = acpi_fwnode_handle(adev); diff --cc drivers/acpi/scan.c index d0277427e7ee1,f96ef8536037a,42cec8120f18e,42cec8120f18e..558664d169fcc --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@@@@ -2235,24 -2228,11 -2235,11 -2235,11 +2228,24 @@@@@ ok return 0; } ---static int acpi_dev_get_first_consumer_dev_cb(struct acpi_dep_data *dep, void *data) +++static int acpi_dev_get_next_consumer_dev_cb(struct acpi_dep_data *dep, void *data) { --- struct acpi_device *adev; +++ struct acpi_device **adev_p = data; +++ struct acpi_device *adev = *adev_p; + -- adev = acpi_bus_get_acpi_device(dep->consumer); +++ /* +++ * If we're passed a 'previous' consumer device then we need to skip +++ * any consumers until we meet the previous one, and then NULL @data +++ * so the next one can be returned. +++ */ +++ if (adev) { +++ if (dep->consumer == adev->handle) +++ *adev_p = NULL; +++ +++ return 0; +++ } ++ - adev = acpi_bus_get_acpi_device(dep->consumer); +++ adev = acpi_get_acpi_dev(dep->consumer); if (adev) { *(struct acpi_device **)data = adev; return 1;