Subject: Re: [RESEND][POWERPC] mpc5200: Amalgamated dts fixes and updates

From: David Gibson <[email-masked]>
Date: Thu, 27 Mar 2008 10:28:11 +1100

On Wed, Mar 26, 2008 at 10:57:30PM +0000, Matt Sealey wrote:
> David Gibson wrote:
>> On Wed, Mar 26, 2008 at 03:16:47PM -0600, Grant Likely wrote:
>>> On Wed, Mar 26, 2008 at 3:02 PM, Matt Sealey <[email-masked]> wrote:
>>>> Bartlomiej Sieka wrote:
>>>>  > +
>>>>  > +                     phy0:ethernet-phy@0 {
>>>>  > +                             device_type = "ethernet-phy";@0"
>>>>  > +                             reg = <0>;
>>>>  > +                     };
>>>>
>>>>  What's the parsing of this pan out to? What does it mean?
>>>>
>>>>  Having colons in device names is totally contrary to OF device naming
>>>>  spec. Does the part after the colon have a special meaning to the DTC?
>>> "phy0:" is a label used by dtc.
>>> "ethernet-phy@0" is the node name.
>> I would suggest a space after the colon though, to make this clearer.
>> That's the style I've been using in all my dts files.
>
> I would suggest taking a hint from C structures...
>
> ethernet-phy@0 {
> 	name = "ethernet-phy";
> 	reg = <0>;
> 	foo = bar;
> } phy0;
>
> I mean, this is really intuitive, we all do this every day...

That's a terrible analogy though.  The OF name is in no way like a
structure's type, which is what would go there.  Plus it separates the
label from the top of the node which will make it harder to read.

The label syntax is already based on C labels, and can be used more
places than just nodes.  Putting a space should make it rather
clearer, and is also closer to normal C style (how many people would
write
	out:return(err);

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson