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 merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V1Cyo-0003pz-FC for barebox@lists.infradead.org; Mon, 22 Jul 2013 10:05:06 +0000 From: Sascha Hauer Subject: [PATCH 8/8] mtd: nand: update to v3.11-rc1 Date: Mon, 22 Jul 2013 12:04:10 +0200 Message-Id: <1374487450-13800-9-git-send-email-s.hauer@pengutronix.de> In-Reply-To: <1374487450-13800-1-git-send-email-s.hauer@pengutronix.de> References: <1374487450-13800-1-git-send-email-s.hauer@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 To: barebox@lists.infradead.org VGhpcyB1cGRhdGVzIHRoZSBOQU5EIHN0dWZmIHRvIExpbnV4LTMuMTEtcmMxLiBJdCBpcyBzeW5j aHJvbml6ZWQKYXMgYmVzdCBhcyB3ZSBjYW4gZ2V0OgoKLSBsb2NrcyByZW1vdmVkCi0gVGhlIHNw bGl0dGluZyBpbiBkaWZmZXJlbnQgZmlsZXMgd2UgaGFkIHRvIGJldHRlciBzdXBwb3J0IGRpZmZl cmVudAogIGZlYXR1cmVzIGhhcyBiZWVuIGRyb3BwZWQuIEluc3RlYWQgdGhpcyBpcyBub3cgZG9u ZSBtb3N0bHkgd2l0aCB0aGUKICB1c2Ugb2YgX19tYXliZV91bnVzZWQKClNvbWUgYmFyZWJveCBh ZGp1c3RtZW50cyBhcmUgZm9yd2FyZCBwb3J0ZWQsIGxpa2U6CgotIEFsbG93IHBhcnRpYWwgcGFn ZSB3cml0ZXMKLSBPcHRpb25hbGx5IGFsbG93IHRvIGVyYXNlIGJhZCBibG9ja3MKLSBjaGVjayBm b3IgYWxsX2ZmIGJlZm9yZSB3cml0aW5nIGEgcGFnZQoKU2lnbmVkLW9mZi1ieTogU2FzY2hhIEhh dWVyIDxzLmhhdWVyQHBlbmd1dHJvbml4LmRlPgotLS0KIGFyY2gvYXJtL2JvYXJkcy9uaGs4ODE1 L3NldHVwLmMgICAgICAgIHwgICAgMiAtCiBkcml2ZXJzL210ZC9uYW5kL0tjb25maWcgICAgICAg ICAgICAgICB8ICAgMjkgKy0KIGRyaXZlcnMvbXRkL25hbmQvTWFrZWZpbGUgICAgICAgICAgICAg IHwgICAgNSArLQogZHJpdmVycy9tdGQvbmFuZC9hdG1lbF9uYW5kLmMgICAgICAgICAgfCAgIDE1 ICstCiBkcml2ZXJzL210ZC9uYW5kL25hbmQuaCAgICAgICAgICAgICAgICB8ICAgIDMgKy0KIGRy aXZlcnMvbXRkL25hbmQvbmFuZF9iYXNlLmMgICAgICAgICAgIHwgMzAxMSArKysrKysrKysrKysr KysrKysrKysrKysrLS0tLS0tLQogZHJpdmVycy9tdGQvbmFuZC9uYW5kX2JidC5jICAgICAgICAg ICAgfCAxMDQ3ICsrKysrKy0tLS0tCiBkcml2ZXJzL210ZC9uYW5kL25hbmRfYmNoLmMgICAgICAg ICAgICB8ICAyNDMgKysrCiBkcml2ZXJzL210ZC9uYW5kL25hbmRfaHdlY2MuYyAgICAgICAgICB8 ICAxMDMgLS0KIGRyaXZlcnMvbXRkL25hbmQvbmFuZF9od2VjY19zeW5kcm9tZS5jIHwgIDIyNSAt LS0KIGRyaXZlcnMvbXRkL25hbmQvbmFuZF9pZHMuYyAgICAgICAgICAgIHwgIDI2NiArKy0KIGRy aXZlcnMvbXRkL25hbmQvbmFuZF9pbXguYyAgICAgICAgICAgIHwgICAyMCArLQogZHJpdmVycy9t dGQvbmFuZC9uYW5kX214cy5jICAgICAgICAgICAgfCAgIDE1ICstCiBkcml2ZXJzL210ZC9uYW5k L25hbmRfb21hcF9ncG1jLmMgICAgICB8ICAgMTAgKy0KIGRyaXZlcnM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HN0cnVjdCBtdGRfb29iX29wcyAqb3BzKQoreworCWludCByZXQgPSAtRU5PVFNV UFA7CisKKwlpZiAoIUlTX0VOQUJMRUQoQ09ORklHX05BTkRfUkVBRF9PT0IpKQorCQlyZXR1cm4g LUVOT1RTVVBQOworCisJb3BzLT5yZXRsZW4gPSAwOworCisJLyogRG8gbm90IGFsbG93IHJlYWRz IHBhc3QgZW5kIG9mIGRldmljZSAqLworCWlmIChvcHMtPmRhdGJ1ZiAmJiAoZnJvbSArIG9wcy0+ bGVuKSA+IG10ZC0+c2l6ZSkgeworCQlwcl9kZWJ1ZygiJXM6IGF0dGVtcHQgdG8gcmVhZCBiZXlv bmQgZW5kIG9mIGRldmljZVxuIiwKKwkJCQlfX2Z1bmNfXyk7CisJCXJldHVybiAtRUlOVkFMOwor CX0KKworCW5hbmRfZ2V0X2RldmljZShtdGQsIEZMX1JFQURJTkcpOworCisJc3dpdGNoIChvcHMt Pm1vZGUpIHsKKwljYXNlIE1URF9PUFNfUExBQ0VfT09COgorCWNhc2UgTVREX09QU19BVVRPX09P QjoKKwljYXNlIE1URF9PUFNfUkFXOgorCQlicmVhazsKKworCWRlZmF1bHQ6CisJCWdvdG8gb3V0 OworCX0KKworCWlmICghb3BzLT5kYXRidWYpCisJCXJldCA9IG5hbmRfZG9fcmVhZF9vb2IobXRk LCBmcm9tLCBvcHMpOworCWVsc2UKKwkJcmV0ID0gbmFuZF9kb19yZWFkX29wcyhtdGQsIGZyb20s IG9wcyk7CisKK291dDoKKwluYW5kX3JlbGVhc2VfZGV2aWNlKG10ZCk7CisJcmV0dXJuIHJldDsK K30KKworCisvKioKKyAqIG5hbmRfd3JpdGVfcGFnZV9yYXcgLSBbSU5URVJOXSByYXcgcGFnZSB3 cml0ZSBmdW5jdGlvbgorICogQG10ZDogbXRkIGluZm8gc3RydWN0dXJlCisgKiBAY2hpcDogbmFu ZCBjaGlwIGluZm8gc3RydWN0dXJlCisgKiBAYnVmOiBkYXRhIGJ1ZmZlcgorIC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mdf bW9kZSk7Cit9CisKKy8qIHJldHVybiB0aGUgc3VwcG9ydGVkIHN5bmNocm9ub3VzIHRpbWluZyBt b2RlLiAqLworc3RhdGljIGlubGluZSBpbnQgb25maV9nZXRfc3luY190aW1pbmdfbW9kZShzdHJ1 Y3QgbmFuZF9jaGlwICpjaGlwKQoreworCWlmICghY2hpcC0+b25maV92ZXJzaW9uKQorCQlyZXR1 cm4gT05GSV9USU1JTkdfTU9ERV9VTktOT1dOOworCXJldHVybiBsZTE2X3RvX2NwdShjaGlwLT5v bmZpX3BhcmFtcy5zcmNfc3luY190aW1pbmdfbW9kZSk7Cit9CiAKICNlbmRpZiAvKiBfX0xJTlVY X01URF9OQU5EX0ggKi8KLS0gCjEuOC4zLjIKCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fXwpiYXJlYm94IG1haWxpbmcgbGlzdApiYXJlYm94QGxpc3RzLmlu ZnJhZGVhZC5vcmcKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcvbWFpbG1hbi9saXN0aW5mby9i YXJlYm94Cg==