]> git.baikalelectronics.ru Git - kernel.git/commit
PCI/ACPI: add a helper for retrieving _OSC Control DWORDs
authorVishal Verma <vishal.l.verma@intel.com>
Wed, 13 Apr 2022 07:36:16 +0000 (01:36 -0600)
committerDan Williams <dan.j.williams@intel.com>
Thu, 28 Apr 2022 21:01:54 +0000 (14:01 -0700)
commita5fcdb4b60b0b32a696a365cc8fe2a392c1defba
tree410c5cbdf19f45d8582535acebafc90ba433d1db
parentcfb3d9d1c8eedd238d600a815f911fd397da80cd
PCI/ACPI: add a helper for retrieving _OSC Control DWORDs

During _OSC negotiation, when the 'Control' DWORD is needed from the
result buffer after running _OSC, a couple of places performed manual
pointer arithmetic to offset into the right spot in the raw buffer.
Add a acpi_osc_ctx_get_pci_control() helper to use the #define'd
DWORD offsets to fetch the DWORDs needed from @acpi_osc_context, and
replace the above instances of the open-coded arithmetic.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Suggested-by: Davidlohr Bueso <dave@stgolabs.net>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed by: Adam Manzanares <a.manzanares@samsung.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Link: https://lore.kernel.org/r/20220413073618.291335-2-vishal.l.verma@intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/acpi/bus.c
drivers/acpi/pci_root.c
include/linux/acpi.h