From patchwork Wed Jun 8 15:59:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 99457 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 8EA88B6FBA for ; Thu, 9 Jun 2011 02:00: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 1QULAf-0005ja-FQ; Wed, 08 Jun 2011 15:59:53 +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 1QULAf-0006xj-18; Wed, 08 Jun 2011 15:59:53 +0000 Received: from mail-wy0-f177.google.com ([74.125.82.177]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QULAc-0006xQ-2i for linux-mtd@lists.infradead.org; Wed, 08 Jun 2011 15:59:50 +0000 Received: by wyb28 with SMTP id 28so623673wyb.36 for ; Wed, 08 Jun 2011 08:59:47 -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; bh=wHAW7bpyphnfn3Co4aRGlAg1jf6h0FhsFw8v3TsgGRA=; b=QHgqac8hyFnYZnfvCzxylbq/GyeAY8tZklwc24KCfPL0Vk4bK7inGzR4LkUGjAeXMX V2zcXz193YAaQr11ukGG4fgPhBtg8GyCfyhs4Eb3unJSJKRo9w+UY8ZW7jTi0rkCJ9fB +uybL/42pZlsVELqVAdsGUv5MO4H75qSIsImY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=mPdPYeELm0GxpB2OKuNsNJrBGs0yoHYELHSBnW3JYuZMLAVWmLZPHeVCkRzBueD0Te TFNK2UFF+n+tTPqTFWDgH9sbx18m0KG7yCxzQ2xi9f+H6J8LIfjIzXAd8b1HNSnxmO5Q 45jQjQcKq9oNSZq1rsTgFillUQa2pznEJ6q9U= Received: by 10.216.237.205 with SMTP id y55mr5258733weq.14.1307548787524; Wed, 08 Jun 2011 08:59:47 -0700 (PDT) Received: from doriath.ww600.siemens.net ([91.213.169.4]) by mx.google.com with ESMTPS id ex2sm521869wbb.14.2011.06.08.08.59.45 (version=SSLv3 cipher=OTHER); Wed, 08 Jun 2011 08:59:46 -0700 (PDT) From: Dmitry Eremin-Solenikov To: linux-mtd@lists.infradead.org Subject: [PATCH] mtd: lart.c: cleanup: drop HAVE_PARTITIONS Date: Wed, 8 Jun 2011 19:59:49 +0400 Message-Id: <1307548789-5733-1-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 1.7.4.4 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110608_115950_377027_F1C772E9 X-CRM114-Status: GOOD ( 15.12 ) 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.177 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 Consolidate knowledge about partitions in drivers/mtd/devices/lart.c. Drop all HAVE_PARTITIONS conditionals. Always use partitioning. Signed-off-by: Dmitry Eremin-Solenikov --- drivers/mtd/devices/lart.c | 18 +----------------- 1 files changed, 1 insertions(+), 17 deletions(-) diff --git a/drivers/mtd/devices/lart.c b/drivers/mtd/devices/lart.c index 772a0ff..3a11ea6 100644 --- a/drivers/mtd/devices/lart.c +++ b/drivers/mtd/devices/lart.c @@ -34,9 +34,6 @@ /* debugging */ //#define LART_DEBUG -/* partition support */ -#define HAVE_PARTITIONS - #include #include #include @@ -44,9 +41,7 @@ #include #include #include -#ifdef HAVE_PARTITIONS #include -#endif #ifndef CONFIG_SA1100_LART #error This is for LART architecture only @@ -598,7 +593,6 @@ static struct mtd_erase_region_info erase_regions[] = { } }; -#ifdef HAVE_PARTITIONS static struct mtd_partition lart_partitions[] = { /* blob */ { @@ -619,7 +613,7 @@ static struct mtd_partition lart_partitions[] = { .size = INITRD_LEN, /* MTDPART_SIZ_FULL */ } }; -#endif +#define NUM_PARTITIONS ARRAY_SIZE(lart_partitions) static int __init lart_flash_init (void) { @@ -668,7 +662,6 @@ static int __init lart_flash_init (void) result,mtd.eraseregions[result].erasesize,mtd.eraseregions[result].erasesize / 1024, result,mtd.eraseregions[result].numblocks); -#ifdef HAVE_PARTITIONS printk ("\npartitions = %d\n", ARRAY_SIZE(lart_partitions)); for (result = 0; result < ARRAY_SIZE(lart_partitions); result++) @@ -681,25 +674,16 @@ static int __init lart_flash_init (void) result,lart_partitions[result].offset, result,lart_partitions[result].size,lart_partitions[result].size / 1024); #endif -#endif -#ifndef HAVE_PARTITIONS - result = mtd_device_register(&mtd, NULL, 0); -#else result = mtd_device_register(&mtd, lart_partitions, ARRAY_SIZE(lart_partitions)); -#endif return (result); } static void __exit lart_flash_exit (void) { -#ifndef HAVE_PARTITIONS - mtd_device_unregister(&mtd); -#else mtd_device_unregister(&mtd); -#endif } module_init (lart_flash_init);