From patchwork Mon Aug 8 18:26:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 109056 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 DD2DEB6F71 for ; Tue, 9 Aug 2011 04:27:36 +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 1QqUXs-0006xZ-PO; Mon, 08 Aug 2011 18:27:24 +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 1QqUXs-00084d-8P; Mon, 08 Aug 2011 18:27:24 +0000 Received: from mms2.broadcom.com ([216.31.210.18]) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QqUXo-00084J-LD for linux-mtd@lists.infradead.org; Mon, 08 Aug 2011 18:27:21 +0000 Received: from [10.9.200.131] by mms2.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Mon, 08 Aug 2011 11:32:28 -0700 X-Server-Uuid: D3C04415-6FA8-4F2C-93C1-920E106A2031 Received: from mail-irva-13.broadcom.com (10.11.16.103) by IRVEXCHHUB01.corp.ad.broadcom.com (10.9.200.131) with Microsoft SMTP Server id 8.2.247.2; Mon, 8 Aug 2011 11:27:01 -0700 Received: from localhost.localdomain (ld-irv-0074 [10.12.160.50]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id DCAC174D04; Mon, 8 Aug 2011 11:27:00 -0700 (PDT) From: "Brian Norris" To: "Artem Bityutskiy" Subject: [PATCH] mtd: plat_nand: fix `bbt_options' compile error Date: Mon, 8 Aug 2011 11:26:33 -0700 Message-ID: <1312827993-19163-1-git-send-email-computersforpeace@gmail.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 X-WSS-ID: 625EF43F3W42800298-13-01 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110808_142720_914048_D97684A4 X-CRM114-Status: GOOD ( 14.59 ) X-Spam-Score: 1.2 (+) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (computersforpeace[at]gmail.com) 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED 1.2 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list Cc: Brian Norris , Linux Kernel , linux-mtd@lists.infradead.org, axel.lin@gmail.com, avorontsov@ru.mvista.com, David Woodhouse 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: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This fixes a bug in commit 86cb232d4e6b589be3daef8d570d1921c05be962 ("mtd: nand: consolidate redundant flash-based BBT flags"). The problem was reported by Axel Lin at: http://lists.infradead.org/pipermail/linux-mtd/2011-August/037340.html In restructuring a few of the fields in `struct nand_chip' and similar, I overlooked my reference to a field in `struct platform_nand_chip' that didn't exist. He discovered the bug via an ARM build that I didn't test: make orion5x_defconfig make CC arch/arm/mach-orion5x/ts78xx-setup.o arch/arm/mach-orion5x/ts78xx-setup.c:278: error: unknown field 'bbt_options' specified in initializer make[1]: *** [arch/arm/mach-orion5x/ts78xx-setup.o] Error 1 make: *** [arch/arm/mach-orion5x] Error 2 The fix is simply to add the new `bbt_options' field to `platform_nand_chip' and to pass those options on to `nand_chip' during its initialization. I re-reviewed the rest of my previous commit and didn't find any other similar errors. Based on: git://git.infradead.org/users/dedekind/l2-mtd-2.6.git Reported-by: Axel Lin Signed-off-by: Brian Norris --- drivers/mtd/nand/plat_nand.c | 1 + include/linux/mtd/nand.h | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c index e62468b..ea8e123 100644 --- a/drivers/mtd/nand/plat_nand.c +++ b/drivers/mtd/nand/plat_nand.c @@ -77,6 +77,7 @@ static int __devinit plat_nand_probe(struct platform_device *pdev) data->chip.read_buf = pdata->ctrl.read_buf; data->chip.chip_delay = pdata->chip.chip_delay; data->chip.options |= pdata->chip.options; + data->chip.bbt_options |= pdata->chip.bbt_options; data->chip.ecc.hwctl = pdata->ctrl.hwcontrol; data->chip.ecc.layout = pdata->chip.ecclayout; diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index ebd806f..f4fdb1e 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -604,6 +604,7 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, * @partitions: mtd partition list * @chip_delay: R/B delay value in us * @options: Option flags, e.g. 16bit buswidth + * @bbt_options: BBT option flags, e.g. NAND_BBT_USE_FLASH * @ecclayout: ECC layout info structure * @part_probe_types: NULL-terminated array of probe types */ @@ -615,6 +616,7 @@ struct platform_nand_chip { struct nand_ecclayout *ecclayout; int chip_delay; unsigned int options; + unsigned int bbt_options; const char **part_probe_types; };