From patchwork Wed Jun 8 16:05:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 99464 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 587BAB6FBA for ; Thu, 9 Jun 2011 02:07:22 +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 1QULHZ-0008Gz-SB; Wed, 08 Jun 2011 16:07:02 +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 1QULHZ-0007UR-9g; Wed, 08 Jun 2011 16:07:01 +0000 Received: from mail-ww0-f49.google.com ([74.125.82.49]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QULGc-0007Bz-V8 for linux-mtd@lists.infradead.org; Wed, 08 Jun 2011 16:06:04 +0000 Received: by mail-ww0-f49.google.com with SMTP id 39so531325wwb.18 for ; Wed, 08 Jun 2011 09:06:02 -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=UHowlmaBYU7ix0fzp+DnhXoi8KxAFQ4+OCIiG6aBQ9w=; b=QaSeKPl5o7DCZWEOJ4YuMj2TkxxKJtmgoEvVfOUy0B2fHQ3eTUCAqyxkOZG9jL94Sf QWDxWzcdvOusix+iVcRoHldixoUL1O87W4olOU1v+gYkq6ytVw3iKv09m3cWl8g2Q/P/ jcgECjmuraG2a46IQVMP75MpcluE8akBaPvxA= 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=h21/lcYcGCi/Kl4MuPZ+j4R9+jT+WOb/6lVZeNMHUWFN8i1IDAE1Gi1voEUeq3S1GE kEVcJ3XNwsUJX2avSpo2SpckyxjMfVRHMP377q17ZqV2Xup5MS+ELwHCtPfDEM0yRq7G 16kVjThsaE/cVyKYPOxNV/ip4R8KhPezPnlFE= Received: by 10.227.199.19 with SMTP id eq19mr7851967wbb.75.1307549162588; Wed, 08 Jun 2011 09:06:02 -0700 (PDT) Received: from doriath.ww600.siemens.net ([91.213.169.4]) by mx.google.com with ESMTPS id p21sm526733wbh.6.2011.06.08.09.06.00 (version=SSLv3 cipher=OTHER); Wed, 08 Jun 2011 09:06:01 -0700 (PDT) From: Dmitry Eremin-Solenikov To: linux-mtd@lists.infradead.org Subject: [PATCH 05/43] mtd: dc21285.c: use mtd_device_parse_register Date: Wed, 8 Jun 2011 20:05:14 +0400 Message-Id: <1307549152-7085-6-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1307549152-7085-1-git-send-email-dbaryshkov@gmail.com> References: <1307549152-7085-1-git-send-email-dbaryshkov@gmail.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110608_120603_246372_933D8228 X-CRM114-Status: GOOD ( 13.91 ) 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.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 , Russell King , 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/maps/dc21285.c | 9 +-------- 1 files changed, 1 insertions(+), 8 deletions(-) diff --git a/drivers/mtd/maps/dc21285.c b/drivers/mtd/maps/dc21285.c index 7a9e198..f43b365 100644 --- a/drivers/mtd/maps/dc21285.c +++ b/drivers/mtd/maps/dc21285.c @@ -145,14 +145,10 @@ static struct map_info dc21285_map = { /* Partition stuff */ -static struct mtd_partition *dc21285_parts; static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; static int __init init_dc21285(void) { - - int nrparts; - /* Determine bankwidth */ switch (*CSR_SA110_CNTL & (3<<14)) { case SA110_CNTL_ROMWIDTH_8: @@ -200,8 +196,7 @@ static int __init init_dc21285(void) dc21285_mtd->owner = THIS_MODULE; - nrparts = parse_mtd_partitions(dc21285_mtd, probes, &dc21285_parts, 0); - mtd_device_register(dc21285_mtd, dc21285_parts, nrparts); + mtd_device_parse_register(dc21285_mtd, probes, 0, NULL, 0); if(machine_is_ebsa285()) { /* @@ -224,8 +219,6 @@ static int __init init_dc21285(void) static void __exit cleanup_dc21285(void) { mtd_device_unregister(dc21285_mtd); - if (dc21285_parts) - kfree(dc21285_parts); map_destroy(dc21285_mtd); iounmap(dc21285_map.virt); }