From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YJTsA-0000Zq-63 for barebox@lists.infradead.org; Thu, 05 Feb 2015 21:22:02 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 5 Feb 2015 22:21:30 +0100 Message-Id: <1423171292-26728-2-git-send-email-u.kleine-koenig@pengutronix.de> In-Reply-To: <1423171292-26728-1-git-send-email-u.kleine-koenig@pengutronix.de> References: <1423171292-26728-1-git-send-email-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 1/3] mtd: nand-imx: fix byte reading in x16 mode To: barebox@lists.infradead.org VGhlcmUgYXJlIGEgZmV3IE5BTkQgY29tbWFuZHMgdGhhdCBtYWtlIHRoZSBjaGlwIG9ubHkgcmVz cG9uZCBvbiBJL08KbGluZXMgMCB0byA3IGV2ZW4gZm9yIHgxNiBkZXZpY2VzLiBSRUFESUQgKDkw aCkgaXMgb25lIHN1Y2ggY29tbWFuZAp3aGljaCB3YXMgYWxyZWFkeSBoYW5kbGVkIGZpbmUgaW4g dGhlIGRyaXZlciAoYXQgbGVhc3QgZm9yIE5GQyB2MSBhbmQKdjIpLiBPdGhlciBjb21tYW5kcyAo bGlrZSBQQVJBTSAoRUNoKSB0byByZWFkIG91dCBPTkZJIHBhcmFtZXRlcnMpCmhvd2V2ZXIgd2Vy ZSBub3QgaGFuZGxlZCBwcm9wZXJseS4gSW5zdGVhZCBvZiBhZGRpbmcgYW5vdGhlciBjYWxsYmFj awptYWtlIHRoZSByZWFkX2J5dGUgY2FsbGJhY2sg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