Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753080AbcKZSLq (ORCPT ); Sat, 26 Nov 2016 13:11:46 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:48224 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753257AbcKZSI3 (ORCPT ); Sat, 26 Nov 2016 13:08:29 -0500 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com uAQI6Ued018512 X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org, Boris Brezillon , Marek Vasut , Brian Norris , Richard Weinberger , David Woodhouse , Cyrille Pitchen Subject: [PATCH 07/39] mtd: nand: denali: transfer OOB only when oob_required is set Date: Sun, 27 Nov 2016 03:05:53 +0900 Message-Id: <1480183585-592-8-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480183585-592-1-git-send-email-yamada.masahiro@socionext.com> References: <1480183585-592-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1212 Lines: 36 Currently, the denali_read_page_raw() always transfers the OOB and copy the data to chip->oob_poi, ignoring the oob_required argument. Respect the oob_required argument. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/denali.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index b2b050b..cbc7f75 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -1182,7 +1182,7 @@ static int denali_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip, BUG(); } - setup_ecc_for_xfer(denali, false, true); + setup_ecc_for_xfer(denali, false, oob_required ? true : false); denali_enable_dma(denali, true); dma_sync_single_for_device(denali->dev, addr, size, DMA_FROM_DEVICE); @@ -1198,7 +1198,9 @@ static int denali_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip, denali_enable_dma(denali, false); memcpy(buf, denali->buf.buf, mtd->writesize); - memcpy(chip->oob_poi, denali->buf.buf + mtd->writesize, mtd->oobsize); + if (oob_required) + memcpy(chip->oob_poi, denali->buf.buf + mtd->writesize, + mtd->oobsize); return 0; } -- 2.7.4