From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wg0-x234.google.com ([2a00:1450:400c:c00::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XEMzJ-0007lS-F3 for barebox@lists.infradead.org; Mon, 04 Aug 2014 18:28:05 +0000 Received: by mail-wg0-f52.google.com with SMTP id a1so8161816wgh.35 for ; Mon, 04 Aug 2014 11:27:38 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20140804174344.GD23235@pengutronix.de> References: <1406899404-29094-1-git-send-email-poggi.raph@gmail.com> <1406899404-29094-2-git-send-email-poggi.raph@gmail.com> <20140804174344.GD23235@pengutronix.de> From: =?UTF-8?Q?Rapha=C3=ABl_Poggi?= Date: Mon, 4 Aug 2014 20:26:58 +0200 Message-ID: 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: Re: [PATCH 1/5] mtd: atmel_nand: add support for device tree To: Sascha Hauer Cc: barebox@lists.infradead.org SGkgU2FzY2hhLAoKVGhhbmtzIGZvciB5b3VyIHJldmlldy4KCkkgd2lsbCBzZW5kIGEgdjIgd2l0 aCB0aGUgbW9kaWZpY2F0aW9uLiBJIHdpbGwgYWxzbyByZW9yZGVyIHBhdGNoZXMgaW4KdGhlIHBh dGNoc2V0LgoKUmFwaGHDq2wKCjIwMTQtMDgtMDQgMTk6NDMgR01UKzAyOjAwIFNhc2NoYSBIYXVl ciA8cy5oYXVlckBwZW5ndXRyb25peC5kZT46Cj4gT24gRnJpLCBBdWcgMDEsIDIwMTQgYXQgMDM6 MjM6MjBQTSArMDIwMCwgUmFwaGHDq2wgUG9nZ2kgd3JvdGU6Cj4+IFNpZ25lZC1vZmYtYnk6IFJh cGhhw6tsIFBvZ2dpIDxwb2dnaS5yYXBoQGdtYWlsLmNvbT4K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