[PATCH] of: Add a reg-names property to name reg entries
From: Cousson, Benoit <hidden>
Date: 2011-10-25 16:10:48
Also in:
linux-devicetree, linux-omap
On 10/25/2011 4:17 PM, Segher Boessenkool wrote:
quoted
quoted
What problem does any of this solve? The device binding for the "mcasp" device will have to describe the possible "reg-names", and what those mean; but the binding already has to describe its "reg" property anyway.What this solve is the ability to use the platform_get_resource_byname directly to retrieve the proper register base address.You do not have to put it in the device tree for that, the device driver can implement this itself if it cares.
??? The driver is the user of that name, so it has to be populated before into the resource during device creation.
quoted
The binding is just a text description that the driver will not be able to use directly. It will have to get the resource using an abstract index.Your reg-names are abstract identifiers just as well.
This is the name used in the HW documentation. Ordering them to get a number is purely arbitrary. That's why using the name will allow the driver to get the resource the way it is represented in the documentation and thus avoid some intermediate number.
quoted
It thus removes a level of indirection that is error prone and useless most of the time.It *adds* a level of indirection. I doubt it helps prevent errors either, but who knows.
Well, if that does not bring anything to you, you can just not use it. Benoit