[net-next PATCH v4 01/15] Documentation: ACPI: DSD: Document MDIO PHY

Andy Shevchenko andy.shevchenko at gmail.com
Fri Jan 29 12:21:07 EST 2021


On Fri, Jan 29, 2021 at 6:44 PM Rafael J. Wysocki <rafael at kernel.org> wrote:
> On Fri, Jan 29, 2021 at 5:37 PM Rafael J. Wysocki <rafael at kernel.org> wrote:
> > On Fri, Jan 29, 2021 at 7:48 AM Calvin Johnson
> > <calvin.johnson at oss.nxp.com> wrote:

...

> > 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



More information about the linux-arm-kernel mailing list