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

ACPI: utils: Introduce acpi_get_local_address()

Introduce a wrapper around the _ADR evaluation.

Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Acked-by: Grant Likely <grant.likely@arm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Calvin Johnson and committed by
David S. Miller
7ec16433 8d2cb3ad

+21
+14
drivers/acpi/utils.c
··· 277 277 278 278 EXPORT_SYMBOL(acpi_evaluate_integer); 279 279 280 + int acpi_get_local_address(acpi_handle handle, u32 *addr) 281 + { 282 + unsigned long long adr; 283 + acpi_status status; 284 + 285 + status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, &adr); 286 + if (ACPI_FAILURE(status)) 287 + return -ENODATA; 288 + 289 + *addr = (u32)adr; 290 + return 0; 291 + } 292 + EXPORT_SYMBOL(acpi_get_local_address); 293 + 280 294 acpi_status 281 295 acpi_evaluate_reference(acpi_handle handle, 282 296 acpi_string pathname,
+7
include/linux/acpi.h
··· 710 710 } 711 711 #endif 712 712 713 + int acpi_get_local_address(acpi_handle handle, u32 *addr); 714 + 713 715 #else /* !CONFIG_ACPI */ 714 716 715 717 #define acpi_disabled 1 ··· 965 963 static inline struct acpi_device *acpi_resource_consumer(struct resource *res) 966 964 { 967 965 return NULL; 966 + } 967 + 968 + static inline int acpi_get_local_address(acpi_handle handle, u32 *addr) 969 + { 970 + return -ENODEV; 968 971 } 969 972 970 973 #endif /* !CONFIG_ACPI */