[RFC PATCH 11/14] ARM: PMU: add device tree probing

Grant Likely grant.likely at secretlab.ca
Wed Aug 25 17:39:52 EST 2010


On Fri, Aug 20, 2010 at 4:56 AM, Lorenzo Pieralisi
<Lorenzo.Pieralisi at arm.com> wrote:
>> Also, (as you've brought up before) the pdev->id issue needs to be
>> solved.  I don't believe it is allowed to change the id field after
>> the platform_device is registered.  I'd rather see the id dynamically
>> assigned, which generally works in the OF use-case because
>> interconnections between devices are described in the tree and
>> specific ids aren't really needed.  However, it could be that the best
>> thing to do is retrieve the system-wide unique id from the aliases
>> node.
>>
>> ... and ditto on my comment that this will be simpler if it lives
>> directly in pmu.c.  :-)
>
> When you say "retrieve the system-wide id from the aliases node" you mean
> at platform_device register time  in the OF layer (ie of_device_register),
> right ?

Not necessarily.  Where possible, I'd rather modify the drivers to not
strictly enforce a 1:1 relationship between the pdev->id, and the
driver's internal enumeration.  Hmmm, that was a little dense, so let
me try again...  In the specific case where id == -1, I'd like to
driver to be able to handle it gracefully and allow the probe routine
to either dynamically assign, or to deduce an appropriate enumeration
value from the aliases node.

I don't have an example of the implementation to show you though.  We
should probably discuss on IRC or have a conf call.  There are a
number of subtleties and details that need to be agreed on here.

Cheers,
g.


More information about the devicetree-discuss mailing list