[PATCH] [MTD] ofpart: Partitions at same address cannot have the same name v3

Segher Boessenkool segher at kernel.crashing.org
Wed Apr 29 10:45:01 EST 2009


> Sometimes, an special partition is included in the device tree  
> including all the
> partitions. Like in:
>
> partition at ff000000 {
>        reg = < 0x000000 0x800000 >;
>        label = "Root File System";
> };
> partition at ff800000 {
>        reg = < 0x800000 0x1a0000 >;
>        label = "Bitstream";
> };
> ...
> full at ff000000 {
>        compatible = "partition";
>        reg = < 0x000000 0x1000000 >;
>        label = "Full FLASH";
> };

Your special "partition" isn't really a partition then, is it.
Because of that, device nodes to represent your partitions doesn't
work very well.

You really want to use something else, a partition table on the
flash itself for example.  Or maybe the (platform? MTD?) code
should create a Linux device for the "full" device.

> Because two nodes of a device tree cannot have the same name,

This isn't true.

> but all the
> partitions must be named "partition",

Bad binding, no cookie for you!

> -		if (strcmp(partname, "partition") != 0) {
> +		if ((strcmp(partname, "partition") != 0) &&
> +			(of_device_is_compatible(pp, "partition") != 1))
> +		{

You cannot claim a name as generic as "partition" for this.  Pick
something else if you really must do things this way.


Segher




More information about the Linuxppc-dev mailing list