From patchwork Mon Oct 3 06:57:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Hitz X-Patchwork-Id: 117406 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 E055DB6F7C for ; Mon, 3 Oct 2011 17:58:40 +1100 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RAcTi-0004Ku-GB; Mon, 03 Oct 2011 06:58:18 +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 1RAcTi-0000Nw-2A; Mon, 03 Oct 2011 06:58:18 +0000 Received: from mail.newtechgroup.ch ([62.12.175.51] helo=newtechgroup.ch) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RAcTe-0000Nd-No for linux-mtd@lists.infradead.org; Mon, 03 Oct 2011 06:58:15 +0000 Received: from vsrv-mail01.newtechgroup.local ([fe80::ed6f:1645:81cd:a25b]) by vsrv-mail01.newtechgroup.local ([fe80::ed6f:1645:81cd:a25b%11]) with mapi; Mon, 3 Oct 2011 08:57:59 +0200 From: "Hitz, Christian" To: "linux-mtd@lists.infradead.org" Date: Mon, 3 Oct 2011 08:57:59 +0200 Subject: [PATCH] mtd: nand: restore useage of ONFI reported bus width Thread-Topic: [PATCH] mtd: nand: restore useage of ONFI reported bus width Thread-Index: AcyBmbiLEdvsPO9rS9+Dxds7ERJtDw== Message-ID: Accept-Language: de-DE, de-CH Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE, de-CH MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20111003_025814_936699_74706417 X-CRM114-Status: GOOD ( 10.85 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 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 patch changes the nand_flash_detect_onfi() function to pass the NAND bus width it discovered via ONFI back to the caller. Signed-off-by: Christian Hitz Acked-by: Florian Fainelli --- drivers/mtd/nand/nand_base.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index a46e9bb..6dae9a0 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -2829,7 +2829,7 @@ static u16 onfi_crc16(u16 crc, u8 const *p, size_t len) * Check if the NAND chip is ONFI compliant, returns 1 if it is, 0 otherwise */ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip, - int busw) + int *busw) { struct nand_onfi_params *p = &chip->onfi_params; int i; @@ -2884,9 +2884,9 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip, mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize; mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page); chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize; - busw = 0; + *busw = 0; if (le16_to_cpu(p->features) & 1) - busw = NAND_BUSWIDTH_16; + *busw = NAND_BUSWIDTH_16; chip->options &= ~NAND_CHIPOPTIONS_MSK; chip->options |= (NAND_NO_READRDY | @@ -2952,7 +2952,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd, chip->onfi_version = 0; if (!type->name || !type->pagesize) { /* Check is chip is ONFI compliant */ - ret = nand_flash_detect_onfi(mtd, chip, busw); + ret = nand_flash_detect_onfi(mtd, chip, &busw); if (ret) goto ident_done; }