On Fri, Jan 29, 2021 at 6:44 PM Rafael J. Wysocki [off-list ref] wrote:
On Fri, Jan 29, 2021 at 5:37 PM Rafael J. Wysocki [off-list ref] wrote:
quoted
On Fri, Jan 29, 2021 at 7:48 AM Calvin Johnson
[off-list ref] wrote:
...
quoted
It would work, but I would introduce a wrapper around the _ADR
evaluation, something like:
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;
}
in drivers/acpi/utils.c and add a static inline stub always returning
-ENODEV for it for !CONFIG_ACPI.
...
BTW, you may not need the fwnode_get_local_addr() at all then, just
evaluate either the "reg" property for OF or acpi_get_local_address()
for ACPI in the "caller" code directly. A common helper doing this can
be added later.
Sounds good to me and it will address your concern about different
semantics of reg/_ADR on per driver/subsystem basis.
--
With Best Regards,
Andy Shevchenko