#size-cells = <0> in a bus node, and kernel messages complaining about this

From: Stephen Warren <hidden>
Date: 2012-06-27 21:26:38

I believe I've seen the following construct bandied about as the correct
way of representing a bunch of nodes that have the same name (since they
represent the same type of object) within device-tree.

	regulators {
		compatible = "simple-bus";
		#address-cells = <1>;
		#size-cells = <0>;

		regulator@0 {
			compatible = "regulator-fixed";
			reg = <0>;
...
		};

		regulator@1 {
			compatible = "regulator-fixed";
			reg = <1>;
...
		};
	};

However, when the kernel parses that, it issues messages such as:

prom_parse: Bad cell count for /regulators/regulator@0
prom_parse: Bad cell count for /regulators/regulator@1

The message is issued when #size-cells==0. Is the response simply "don't
do that", and so I should set #size-cells=1, and add a fake size cell in
the reg property too?

Given the number of hits on '#size-cells = <0>' in the kernel source
tree, it seems like I must be missing something here; it's quite widely
used. I guess the warning is probably only emitted when the node with
#size-cells=0 is a bus, and so the children are enumerated to
instantiated devices; perhaps that's why this hasn't been raised before?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help