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.76 #1 (Red Hat Linux)) id 1Reuqp-00049w-Q3 for barebox@lists.infradead.org; Sun, 25 Dec 2011 20:39:26 +0000 Received: from dude.hi.pengutronix.de ([2001:6f8:1178:2:21e:67ff:fe11:9c5c]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1ReuqA-0000hA-D1 for barebox@lists.infradead.org; Sun, 25 Dec 2011 21:38:42 +0100 Received: from jbe by dude.hi.pengutronix.de with local (Exim 4.77) (envelope-from ) id 1ReuqA-0001LT-AY for barebox@lists.infradead.org; Sun, 25 Dec 2011 21:38:42 +0100 From: Juergen Beisert Date: Sun, 25 Dec 2011 21:38:27 +0100 Message-Id: <1324845517-4601-5-git-send-email-jbe@pengutronix.de> In-Reply-To: <1324845517-4601-1-git-send-email-jbe@pengutronix.de> References: <1324845517-4601-1-git-send-email-jbe@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-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: =?UTF-8?q?=5BPATCH=2004/14=5D=20MACH=20SAMSUNG/S3C=3A=20Use=20the=20correct=20CPU=20family=20name=20to=20reflect=20NAND=20driver=27s=20usage?= To: barebox@lists.infradead.org VGhlIGFyZWFkeSBleGlzdGluZyBOQU5EIGNvbnRyb2xsZXIgZHJpdmVyIGluIEJhcmVib3ggaXMg Zm9yIHRoZSBTM0MyNFhYIGZhbWlseQpvbmx5LiBDaGFuZ2UgdGhlIG5hbWUgb2YgdGhlIGZpbGUg dG8gcmVmbGVjdCB0aGlzIGZhY3QgKGFuZCBmcmVlIHRoZSB3YXkgdG8gYWRkCm1vcmUgcmVjZW50 IFNhbXN1bmcgTkFORCBjb250cm9sbGVycykKClNpZ25lZC1vZmYtYnk6IEp1ZXJnZW4gQmVpc2Vy dCA8amJlQHBlbmd1dHJvbml4LmRlPgotLS0KIGFyY2gvYXJtL2JvYXJkcy9hOW0yNDEwL2E5bTI0 MTAuYyAgICAgICAgICAgICAgICAgfCAgICAyICstCiBhcmNoL2FybS9ib2FyZHMvYTltMjQ0MC9h OW0yNDQwLmMgICAgICAgICAgICAgICAgIHwgICAgMiArLQogYXJjaC9hcm0vYm9hcmRzL21pbmky NDQwL21pbmkyNDQwLmMgICAgICAgICAgICAgICB8ICAgIDIgKy0KIGFyY2gvYXJtL21hY2gtc2Ft c3VuZy9LY29uZmlnICAgICAgICAgICAgICAgICAgICAgfCAgICAyICstCiBhcmNoL2FybS9tYWNo LXNhbXN1bmcvaW5jbHVkZS9tYWNoL3MzYzI0eDAtbmFuZC5oIHwgICA1NCAtLQogYXJjaC9hcm0v bWFjaC1zYW1zdW5nL2luY2x1ZGUvbWFjaC9zM2MyNHh4LW5hbmQuaCB8ICAgNTQgKysKIGRyaXZl cnMvbXRkL25hbmQvS2NvbmZpZyAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICA0ICstCiBk cml2ZXJzL210ZC9uYW5kL01ha2VmaWxlICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgMiAr LQogZHJpdmVycy9tdGQvbmFuZC9uYW5kX3MzYzI0MTAuYyAgICAgICAgICAgICAgICAgICB8ICA2 NjUgLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiBkcml2ZXJzL210ZC9uYW5kL25hbmRfczNjMjR4eC5j ICAgICAgICAgICAgICAgICAgIHwgIDY2NSArKysrKysrKysrKysrKysrKysrKysKIDEwIGZpbGVz IGNoYW5nZWQsIDcyNiBpbnNlcnRpb25zKCspLCA3MjYgZGVsZXRpb25zKC0pCiBkZWxldGUgbW9k ZSAxMDA2NDQgYXJjaC9hcm0vbWFjaC1zYW1zdW5nL2luY2x1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