From patchwork Tue Jun 7 13:36:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 99186 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 013B5B6FC1 for ; Tue, 7 Jun 2011 23:41:14 +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 1QTwWf-0004as-D4; Tue, 07 Jun 2011 13:40:58 +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 1QTwWe-0002OG-QI; Tue, 07 Jun 2011 13:40:56 +0000 Received: from mail-ww0-f41.google.com ([74.125.82.41]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QTwTF-0001Qm-PJ for linux-mtd@lists.infradead.org; Tue, 07 Jun 2011 13:37:27 +0000 Received: by mail-ww0-f41.google.com with SMTP id 18so2387416wwi.0 for ; Tue, 07 Jun 2011 06:37:25 -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=cmF72sG/lzOy0SS+toQsJ8e1kT9yjSjUbvX3DUBz/2c=; b=Stt4WgXx1mfRwRFrIotZp/9G+y+87FRXUcHfvGotnTuuQfq64Qil6yHWjv1aMRmAUX mzY+Bf5EC0053D+a5YQYMVAwCfXpDID+aEvBx9kgLIibtPCb0iG+rOJm8eNvuEhMyCaZ WV293L1xC853HoqWRMIckN3N6u5DZnyigkBo4= 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=Qt76ibbt3pfdJXv4rgjPWlhaYtDk63U95g8IL54HKMnh1Zv1v1jEMppT4NxIaerqb4 EXwqRfZ/2U8aENbpH5Jo9zUgCrXezRK5/pgd8HckOl6MK4tEItfc8OEwloLlm7XX9/Nn fzfFG0g97qRcKTI3b0gWoaVwJhtZJht6vvJnQ= Received: by 10.227.183.76 with SMTP id cf12mr107639wbb.66.1307453845387; Tue, 07 Jun 2011 06:37:25 -0700 (PDT) Received: from doriath.ww600.siemens.net ([91.213.169.4]) by mx.google.com with ESMTPS id fl19sm1689263wbb.66.2011.06.07.06.37.23 (version=SSLv3 cipher=OTHER); Tue, 07 Jun 2011 06:37:24 -0700 (PDT) From: Dmitry Eremin-Solenikov To: linux-mtd@lists.infradead.org Subject: [PATCH 24/44] mtd: cafe_nand.c: use mtd_device_parse_register Date: Tue, 7 Jun 2011 17:36:23 +0400 Message-Id: <1307453803-31950-25-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1307453803-31950-1-git-send-email-dbaryshkov@gmail.com> References: <1307453803-31950-1-git-send-email-dbaryshkov@gmail.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110607_093726_047005_CE29DDE3 X-CRM114-Status: GOOD ( 12.74 ) 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 [74.125.82.41 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 Replace custom invocations of parse_mtd_partitions and mtd_device_register with common mtd_device_parse_register call. This would bring: standard handling of all errors, fallback to default partitions, etc. Signed-off-by: Dmitry Eremin-Solenikov --- drivers/mtd/nand/cafe_nand.c | 11 ++--------- 1 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c index 88ac4b5..db3bfac 100644 --- a/drivers/mtd/nand/cafe_nand.c +++ b/drivers/mtd/nand/cafe_nand.c @@ -57,7 +57,6 @@ struct cafe_priv { struct nand_chip nand; - struct mtd_partition *parts; struct pci_dev *pdev; void __iomem *mmio; struct rs_control *rs; @@ -630,8 +629,6 @@ static int __devinit cafe_nand_probe(struct pci_dev *pdev, struct cafe_priv *cafe; uint32_t ctrl; int err = 0; - struct mtd_partition *parts; - int nr_parts; /* Very old versions shared the same PCI ident for all three functions on the chip. Verify the class too... */ @@ -804,12 +801,8 @@ static int __devinit cafe_nand_probe(struct pci_dev *pdev, mtd_device_register(mtd, NULL, 0); mtd->name = "cafe_nand"; - nr_parts = parse_mtd_partitions(mtd, part_probes, &parts, 0); - if (nr_parts > 0) { - cafe->parts = parts; - dev_info(&cafe->pdev->dev, "%d partitions found\n", nr_parts); - mtd_device_register(mtd, parts, nr_parts); - } + mtd_device_parse_register(mtd, part_probes, 0, NULL, 0); + goto out; out_irq: