From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kVZep-0003YN-4Z for barebox@lists.infradead.org; Thu, 22 Oct 2020 12:25:27 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 22 Oct 2020 14:25:22 +0200 Message-Id: <20201022122522.3303-1-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] mtd: nand-imx: repair reading the oob area To: barebox@lists.infradead.org QWZ0ZXIgc2VuZGluZyB0aGUgUkVBRE9PQiBjb21tYW5kIHRoZSBjb3JlIChpbiBuYW5kX3JlYWRf b29iX3N0ZCgpKSB1c2VzCnRoZSByZWFkX2J1ZiBjYWxsYmFjayB0byBmZXRjaCB0aGUgcmVzdWx0 LiBTbyBpbiB0aGUgaW14IGRyaXZlciBpdCBpcwpuZWNlc3NhcnkgdG8gZW1pdCB0aGUgTkZDX09V VFBVVCBjb21tYW5kIHRvIG1ha2UgdGhlIGNvbnRyb2xsZXIgYWN0dWFsbHkKcmVhZCB0aGUgcmVx dWVzdGVkIGRhdGEgaW50byB0aGUgaW50ZXJuYWwgYnVmZmVyIGFuZCB0aGVuIGNvcHkgdGhlIGRh dGEKdG8gdGhlIGxvY2F0aW9uIHdoZXJlIHJlYWRfYnVmIGV4cGVjdHMgaXQuCgpUaGlzIGZpeGVz IHJlYWRpbmcgZnJvbSAvZGV2L25hbmQwLm9vYiBhbmQgYWxzbyAoc29tZXdoYXQpIHJlYWRpbmcg YmFkCmJsb2NrIG1hcmtlcnMgaW4gdGhlIGFic2VuY2Ugb2YgYSBiYWQg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