Re: How to handle named resources with DT?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/09/2011 12:47 PM, Cousson, Benoit wrote:
> On 8/9/2011 7:23 PM, Grant Likely wrote:
>> There is no analogous mechanism for _byname in the device tree.  The
>> DT binding for a device must explicitly state what order the register
>> ranges are in.  The driver will need to be adapted.
> 
> That seems to be a small regression for my point of view. Relying on the
> order is not super safe. This is not very readable either. That's for
> that exact reason that we changed our drivers to use
> platform_get_resource_byname. That's probably the reason why that API is
> there as well.
> For the same IP, the number of entries can vary depending of the SoC
> revision.
> By using the _byname, we can check if the resource is there or not
> without having to care about the position.

You could have a named u32 property that contains the reg index, e.g.:

dev {
	reg = <0x20000 0x200 0x24000 0x200>;
	foo-reg = <0>;
	bar-reg = <1>;
};

-Scott

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux