Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966117AbbLRCgH (ORCPT ); Thu, 17 Dec 2015 21:36:07 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:41165 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751314AbbLRCgF (ORCPT ); Thu, 17 Dec 2015 21:36:05 -0500 X-Listener-Flag: 11101 From: Bayi Cheng To: David Woodhouse , Brian Norris CC: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Matthias Brugger , Daniel Kurtz , Sascha Hauer , , , , , , , Bayi Cheng Subject: [PATCH] mtd: mtk-nor: adjust sequence of trigger function and assignment function Date: Fri, 18 Dec 2015 10:35:43 +0800 Message-ID: <1450406143-29679-1-git-send-email-bayi.cheng@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1153 Lines: 33 move write data register before excute command to avoid missing first byte write to nor flash Change-Id: Ie9d7ae30f9de1f3e976d2e1de5d8ee28837598c8 Signed-off-by: Bayi Cheng --- drivers/mtd/spi-nor/mtk-quadspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/mtk-quadspi.c b/drivers/mtd/spi-nor/mtk-quadspi.c index dd269650..04da971 100644 --- a/drivers/mtd/spi-nor/mtk-quadspi.c +++ b/drivers/mtd/spi-nor/mtk-quadspi.c @@ -272,10 +272,10 @@ static int mt8173_nor_write_single_byte(struct mt8173_nor *mt8173_nor, mt8173_nor_set_addr(mt8173_nor, addr); for (i = 0; i < length; i++) { + writeb(*data++, mt8173_nor->base + MTK_NOR_WDATA_REG); ret = mt8173_nor_execute_cmd(mt8173_nor, MTK_NOR_PIO_WR_CMD); if (ret < 0) return ret; - writeb(*data++, mt8173_nor->base + MTK_NOR_WDATA_REG); } return 0; } -- 1.8.1.1.dirty -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/