lkml.org 
[lkml]   [2021]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [net-next PATCH v4 09/15] device property: Introduce fwnode_get_id()
On Fri, Jan 22, 2021 at 7:11 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Fri, Jan 22, 2021 at 6:12 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> >
> > On Fri, Jan 22, 2021 at 05:40:41PM +0100, Rafael J. Wysocki wrote:
> > > On Fri, Jan 22, 2021 at 4:46 PM Calvin Johnson
> > > <calvin.johnson@oss.nxp.com> wrote:
> > > >
> > > > Using fwnode_get_id(), get the reg property value for DT node
> > > > or get the _ADR object value for ACPI node.
> > >
> > > So I'm not really sure if this is going to be generically useful.
> > >
> > > First of all, the meaning of the _ADR return value is specific to a
> > > given bus type (e.g. the PCI encoding of it is different from the I2C
> > > encoding of it) and it just happens to be matching the definition of
> > > the "reg" property for this particular binding.
> >
> > > IOW, not everyone may expect the "reg" property and the _ADR return
> > > value to have the same encoding and belong to the same set of values,
> >
> > I have counted three or even four attempts to open code exact this scenario
> > in the past couple of years. And I have no idea where to put a common base for
> > them so they will not duplicate this in each case.
>
> In that case it makes sense to have it in the core, but calling the
> _ADR return value an "id" generically is a stretch to put it lightly.
>
> It may be better to call the function something like
> fwnode_get_local_bus_id()

Or fwnode_get_local_address() for that matter.

\
 
 \ /
  Last update: 2021-01-22 19:45    [W:1.036 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site