From patchwork Sat Jun 11 23:11:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 100044 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3507CB7080 for ; Sun, 12 Jun 2011 09:12:44 +1000 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QVXM2-0000sq-Bw; Sat, 11 Jun 2011 23:12:34 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QVXM1-00018C-RY; Sat, 11 Jun 2011 23:12:33 +0000 Received: from mail-ew0-f49.google.com ([209.85.215.49]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QVXLa-00010O-HM for linux-mtd@lists.infradead.org; Sat, 11 Jun 2011 23:12:07 +0000 Received: by mail-ew0-f49.google.com with SMTP id 3so1527779ewy.36 for ; Sat, 11 Jun 2011 16:12:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=FK2bgGbgO5K51JtiaryePciVDuMrpoVsV8Dq/UpurEk=; b=MDODfwCXS0BgoxJBc/fYXEr+++tL5W3z/0j3kWzj+TfEX+Dut4c1lhCdWi5T0TSgLt yYpisXpfW6iIow0nK5Q4xj6CQONFUocjaovP8jLzVJ5fgB88uoUf519LRAA1QUvYmoZj ITXzgRva2HHyf68xaObsBNkTAoAPiGfsAjPVg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=mLFGHGdgRL3dIqrrmzOZVmMqZi9zmcK+UmIc+yc5H91MgiNpvBXpi4ljjpLKOiZN1G gYHskfVdkwT1Z2kW+UwXPf0kpx46P/W5PYe1AalO57CA/8ls/eQju45Awt9+cjxwZe4p 9VxmSxxFaFq3X+8kutmw7Ra8oG/ihqfB+PaX8= Received: by 10.14.126.3 with SMTP id a3mr1476627eei.203.1307833926146; Sat, 11 Jun 2011 16:12:06 -0700 (PDT) Received: from doriath.lumag.dynalias.net (ppp89-110-7-240.pppoe.avangarddsl.ru [89.110.7.240]) by mx.google.com with ESMTPS id y6sm3745991eem.4.2011.06.11.16.12.04 (version=SSLv3 cipher=OTHER); Sat, 11 Jun 2011 16:12:05 -0700 (PDT) From: Dmitry Eremin-Solenikov To: linux-mtd@lists.infradead.org Subject: [PATCH 03/18] mtd: physmap_of: use ofpart through generic parsing Date: Sun, 12 Jun 2011 03:11:47 +0400 Message-Id: <1307833922-21602-4-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 1.7.5.3 In-Reply-To: <1307833922-21602-1-git-send-email-dbaryshkov@gmail.com> References: <1307833922-21602-1-git-send-email-dbaryshkov@gmail.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110611_191206_751812_38CF3477 X-CRM114-Status: GOOD ( 13.51 ) X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is freemail (dbaryshkov[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RFC_ABUSE_POST Both abuse and postmaster missing on sender domain 0.0 T_TO_NO_BRKTS_FREEMAIL T_TO_NO_BRKTS_FREEMAIL Cc: David Woodhouse , dedekind1@gmail.com X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Convert the driver to use ofpart partitions parsing through the generic parse_mtd_partitions(). Signed-off-by: Dmitry Eremin-Solenikov --- drivers/mtd/maps/physmap_of.c | 13 +++++-------- 1 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c index d251d1d..6a75743 100644 --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c @@ -165,7 +165,8 @@ static struct mtd_info * __devinit obsolete_probe(struct platform_device *dev, specifies the list of partition probers to use. If none is given then the default is use. These take precedence over other device tree information. */ -static const char *part_probe_types_def[] = { "cmdlinepart", "RedBoot", NULL }; +static const char *part_probe_types_def[] = { "cmdlinepart", "RedBoot", + "ofpart", NULL }; static const char ** __devinit of_get_probes(struct device_node *dp) { const char *cp; @@ -218,6 +219,7 @@ static int __devinit of_flash_probe(struct platform_device *dev) int reg_tuple_size; struct mtd_info **mtd_list = NULL; resource_size_t res_size; + struct mtd_part_parser_data ppdata; match = of_match_device(of_flash_match, &dev->dev); if (!match) @@ -331,9 +333,10 @@ static int __devinit of_flash_probe(struct platform_device *dev) if (err) goto err_out; + ppdata.of_node = dp; part_probe_types = of_get_probes(dp); err = parse_mtd_partitions(info->cmtd, part_probe_types, - &info->parts, 0); + &info->parts, &ppdata); if (err < 0) { of_free_probes(part_probe_types); goto err_out; @@ -341,12 +344,6 @@ static int __devinit of_flash_probe(struct platform_device *dev) of_free_probes(part_probe_types); if (err == 0) { - err = of_mtd_parse_partitions(&dev->dev, dp, &info->parts); - if (err < 0) - goto err_out; - } - - if (err == 0) { err = parse_obsolete_partitions(dev, info, dp); if (err < 0) goto err_out;