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

Peter Korsgaard jacmet at sunsite.dk
Wed Apr 22 19:24:01 EST 2009


>>>>> "Ricardo" == Ricardo Ribalda Delgado <ricardo.ribalda at uam.es> writes:

Hi,

 Ricardo> Sometimes, an special partition is included in the device
 Ricardo> tree including all the partitions. Like in:

 Ricardo>  drivers/mtd/ofpart.c |    3 ++-
 Ricardo>  1 files changed, 2 insertions(+), 1 deletions(-)

 Ricardo> diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
 Ricardo> index 3e164f0..0af3b07 100644
 Ricardo> --- a/drivers/mtd/ofpart.c
 Ricardo> +++ b/drivers/mtd/ofpart.c
 Ricardo> @@ -48,7 +48,8 @@ int __devinit of_mtd_parse_partitions(struct device *dev,
 
 Ricardo>  		/* check if this is a partition node */
 Ricardo>  		partname = of_get_property(pp, "name", &len);
 Ricardo> -		if (strcmp(partname, "partition") != 0) {
 Ricardo> +		if (strncmp(partname, "partition", strlen("partition")-1)

Why strlen() - 1 ?

-- 
Bye, Peter Korsgaard



More information about the Linuxppc-dev mailing list