On Thu, 18 Nov 2010 14:08:27 -0800
David VomLehn <[email protected]> wrote:

> On Tue, Nov 09, 2010 at 10:25:37PM -0600, Grant Likely wrote:
> > On Wed, Nov 03, 2010 at 01:50:37PM -0700, David VomLehn wrote:
> > >   device-s {
> > >           compatible = "cisco,device-s";
> > >           cisco,static-buffers = 
> > >                   "device-s-b1",<0x24000000 0x00100000>,
> > >                   "device-s-b2",<0x60000000 0x00200000>;
> > 
> > Or, simply:
> >     cisco,static-buffer-b1 = <0x24000000 0x00100000>;
> >     cisco,static-buffer-b2 = <0x60000000 0x00200000>;
> > 
> > Try to avoid mixing string and cell values in the same property where
> > appropriate.  Sometimes doing so is the best binding, but those cases
> > are rare.
> 
> I started implementing the 'cisco,static-buffer-b1' solution and it feels 
> pretty awkward.
> When I want to get the property value, I have to know not only the constant 
> property
> name but also a buffer name. The buffer name is really one of the pieces of 
> data I
> want to get. I can, of course, write code to scan the node and do a partial 
> match on
> the property name, but that doesn't feel like the rest of the DT API.
> 
> Not only does this have me doing odd things to property names, but I have a 
> number of
> devices. If I should want another buffer, I must create another property name.
> This solution has me creating a bunch of property names, which all I really
> want is two: "cisco,static-buffers" and "cisco,dynamic-buffers".
> 
> I think this is an occasion where it makes sense to mix string and cell 
> values in the
> same property.

How about:

device-s {
        compatible = "cisco,device-s";
        ...

        cisco,static-buffers {
                device-s-b1 = <0x24000000 0x00100000>;
                device-s-b2 = <0x60000000 0x00200000>;
        };
};


-Scott

_______________________________________________
devicetree-discuss mailing list
[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss

Reply via email to