From patchwork Wed Apr 22 08:05:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 26303 Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id D1FD5B6F56 for ; Wed, 22 Apr 2009 18:05:51 +1000 (EST) Received: by ozlabs.org (Postfix) id C5B08DE3FF; Wed, 22 Apr 2009 18:05:29 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id C2BE1DE3FE for ; Wed, 22 Apr 2009 18:05:29 +1000 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.31]) by ozlabs.org (Postfix) with ESMTP id 21AD2DDE9E for ; Wed, 22 Apr 2009 18:05:07 +1000 (EST) Received: by yw-out-2324.google.com with SMTP id 9so1782629ywe.39 for ; Wed, 22 Apr 2009 01:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :date:message-id:x-mailer; bh=YyBeroR3DqdgnLSzT7hiPhbMkisBvmcrlniU6GvGBhM=; b=Nsg9uxZOZEUMXIwjipPbfwU6fznwFjGuMgrB/vE8z1wYlcVoSR8zix5/DaViRp2VTQ pKaRDVkoX+3VGULAaSak8JkqE3UJ0bPCCEjUZrSVoAzo6lffDPC8PG8Ol2AY5uibYuSW rfV4tqeHNj34lzXpmD1oSxMz6kRPXWLkMPdLI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; b=hVhprSDZSOftRBp4iU8GSxs3W+qITRRULKzF+Ms6xzGRZLG7weGEnlrJbYVO8DO1l0 6NZlgPLtZMLf8WE/zY17/mUmX+buxlxsOfQqTWjM6uNz3nVh7Z8zJRHRj9g6Yo0Fc+eZ lT+VR9APwHl2m077rpEv1G/aMseaRUtF2NRNQ= Received: by 10.90.106.3 with SMTP id e3mr10040530agc.54.1240387502660; Wed, 22 Apr 2009 01:05:02 -0700 (PDT) Received: from localhost (aragorn.ii.uam.es [150.244.56.212]) by mx.google.com with ESMTPS id 36sm1058250aga.53.2009.04.22.01.05.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 22 Apr 2009 01:05:01 -0700 (PDT) From: Ricardo Ribalda Delgado To: linuxppc-dev@ozlabs.org, ben@codiert.org, David.Woodhouse@intel.com, linuxppc-embedded@ozlabs.org Subject: [MTD] ofpart: Partitions at same address cannot have the same name Date: Wed, 22 Apr 2009 10:05:41 +0200 Message-Id: <1240387541-16594-1-git-send-email-ricardo.ribalda@uam.es> X-Mailer: git-send-email 1.6.2.4 Cc: Ricardo Ribalda Delgado X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Sometimes, an special partition is included in the device tree including all the partitions. Like in: partition@ff000000 { reg = < 0x000000 0x800000 >; label = "Root File System"; }; partition@ff800000 { reg = < 0x800000 0x1a0000 >; label = "Bitstream"; }; ... partitionAll@ff000000 { reg = < 0x000000 0x1000000 >; label = "Full FLASH"; }; Because two nodes of a device tree cannot have the same name, but all the partitions must be named "partition", this special partition is invalid. This patch makes ofpart.c only check for the firt part of the name, and ignore the rest, allowing this special partition. --- The extra partition is quite useful while formating the full firmware from linux drivers/mtd/ofpart.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c index 3e164f0..0af3b07 100644 --- a/drivers/mtd/ofpart.c +++ b/drivers/mtd/ofpart.c @@ -48,7 +48,8 @@ int __devinit of_mtd_parse_partitions(struct device *dev, /* check if this is a partition node */ partname = of_get_property(pp, "name", &len); - if (strcmp(partname, "partition") != 0) { + if (strncmp(partname, "partition", strlen("partition")-1) + != 0) { nr_parts--; continue; }