Commit 7ec16433 authored by Calvin Johnson's avatar Calvin Johnson Committed by David S. Miller

ACPI: utils: Introduce acpi_get_local_address()

Introduce a wrapper around the _ADR evaluation.
Signed-off-by: default avatarCalvin Johnson <calvin.johnson@oss.nxp.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
Acked-by: default avatarRafael J. Wysocki <rafael@kernel.org>
Acked-by: default avatarGrant Likely <grant.likely@arm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8d2cb3ad
...@@ -277,6 +277,20 @@ acpi_evaluate_integer(acpi_handle handle, ...@@ -277,6 +277,20 @@ acpi_evaluate_integer(acpi_handle handle,
EXPORT_SYMBOL(acpi_evaluate_integer); EXPORT_SYMBOL(acpi_evaluate_integer);
int acpi_get_local_address(acpi_handle handle, u32 *addr)
{
unsigned long long adr;
acpi_status status;
status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, &adr);
if (ACPI_FAILURE(status))
return -ENODATA;
*addr = (u32)adr;
return 0;
}
EXPORT_SYMBOL(acpi_get_local_address);
acpi_status acpi_status
acpi_evaluate_reference(acpi_handle handle, acpi_evaluate_reference(acpi_handle handle,
acpi_string pathname, acpi_string pathname,
......
...@@ -710,6 +710,8 @@ static inline u64 acpi_arch_get_root_pointer(void) ...@@ -710,6 +710,8 @@ static inline u64 acpi_arch_get_root_pointer(void)
} }
#endif #endif
int acpi_get_local_address(acpi_handle handle, u32 *addr);
#else /* !CONFIG_ACPI */ #else /* !CONFIG_ACPI */
#define acpi_disabled 1 #define acpi_disabled 1
...@@ -965,6 +967,11 @@ static inline struct acpi_device *acpi_resource_consumer(struct resource *res) ...@@ -965,6 +967,11 @@ static inline struct acpi_device *acpi_resource_consumer(struct resource *res)
return NULL; return NULL;
} }
static inline int acpi_get_local_address(acpi_handle handle, u32 *addr)
{
return -ENODEV;
}
#endif /* !CONFIG_ACPI */ #endif /* !CONFIG_ACPI */
#ifdef CONFIG_ACPI_HOTPLUG_IOAPIC #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment