devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* case sensitivity for devicetree node names
@ 2016-06-10 20:05 Frank Rowand
       [not found] ` <575B1D84.2010703-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Frank Rowand @ 2016-06-10 20:05 UTC (permalink / raw)
  To: Rob Herring, Grant Likely, David Gibson,
	devicetree-spec-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

I had assumed that devicetree node names were case sensitive. But a recent
email thread asserted that they were not, which made me curious.

dtc treats node names as case sensitive:

$ cat test_node_case_1.dts

/dts-v1/;

/ {
	node-x {
		prop_a = < 1 >;
	};
};

/ {
	node-X {
		prop_a = < 2 >;
	};
};

$ cat test_node_case_2.dts

/dts-v1/;

/ {
	node-x {
		prop_a = < 1 >;
	};
};

/ {
	node-x {
		prop_a = < 2 >;
	};
};

$ dtc -O dts test_node_case_1.dts
/dts-v1/;

/ {

	node-x {
		prop_a = <0x1>;
	};

	node-X {
		prop_a = <0x2>;
	};
};

$ dtc -O dts test_node_case_2.dts
/dts-v1/;

/ {

	node-x {
		prop_a = <0x2>;
	};
};


But the Linux kernel source code defines of_node_cmp() as:

  include/linux/of.h:

  /* Default string compare functions, Allow arch asm/prom.h to override */
  #if !defined(of_compat_cmp)
  #define of_node_cmp(s1, s2) strcasecmp((s1), (s2))

arch/sparc/include/asm/prom.h uses strcmp() instead of strcasecmp().

Examples of using of_node_cmp() to check for a node name can be found,
for example, of_find_node_by_name().

Is case insensitivity for node names a bug in the Linux kernel, or desired
for some reason?

-Frank

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-06-14  6:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-10 20:05 case sensitivity for devicetree node names Frank Rowand
     [not found] ` <575B1D84.2010703-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-10 21:38   ` Rob Herring
     [not found]     ` <CAL_JsqKw8dVp5y487fo6_mwZfeN6ww8HiYnsudnB8afBrv2oMQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-10 22:02       ` Frank Rowand
2016-06-11 19:38   ` Frank Rowand
     [not found]     ` <575C68A1.1020701-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-11 22:05       ` Benjamin Herrenschmidt
     [not found]         ` <1465682743.19533.18.camel-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
2016-06-12 18:39           ` Frank Rowand
     [not found]             ` <575DAC69.5010804-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-12 21:56               ` Benjamin Herrenschmidt
2016-06-14  1:10   ` David Gibson
     [not found]     ` <20160614011021.GD4882-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
2016-06-14  3:53       ` Frank Rowand
     [not found]         ` <575F7FC1.5040508-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-14  5:10           ` David Gibson
     [not found]             ` <20160614051028.GL4882-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
2016-06-14  5:29               ` Frank Rowand
     [not found]                 ` <575F963F.8090105-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-14  6:05                   ` David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).