From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp2-g21.free.fr ([2a01:e0c:1:1599::11]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SVHpK-0003J8-IC for barebox@lists.infradead.org; Fri, 18 May 2012 07:42:21 +0000 Received: from localhost.localdomain (unknown [82.240.38.71]) by smtp2-g21.free.fr (Postfix) with ESMTP id 51B684B0113 for ; Fri, 18 May 2012 09:42:13 +0200 (CEST) From: =?UTF-8?q?Eric=20B=C3=A9nard?= Date: Fri, 18 May 2012 09:41:44 +0200 Message-Id: <1337326905-555-9-git-send-email-eric@eukrea.com> In-Reply-To: <1337326905-555-1-git-send-email-eric@eukrea.com> References: <1337326905-555-1-git-send-email-eric@eukrea.com> 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: [PATCH v2 09/10] eukrea_cpuimx35: fix PHY address and clean code To: barebox@lists.infradead.org dGhpcyBwYXRjaCBhbHNvIGNsZWFucyB0aGUgc291cmNlIGJ5IHB1dHRpbmcgaW4gZGV2aWNlX2lu aXQKdGhlIGNvZGUgd2hpY2ggaXMgYWN0dWFsbHkgaW4gY29uc29sZV9pbml0IGFuZCBoYXMgbm90 aGluZwp0byBzZWUgd2l0aCB0aGUgY29uc29sZS4KClNpZ25lZC1vZmYtYnk6IEVyaWMgQsOpbmFy ZCA8ZXJpY0BldWtyZWEuY29tPgotLS0KIGFyY2gvYXJtL2JvYXJkcy9ldWtyZWFfY3B1aW14MzUv ZXVrcmVhX2NwdWlteDM1LmMgfCAgIDkwICsrKysrKysrKystLS0tLS0tLS0tCiAxIGZpbGVzIGNo YW5nZWQsIDQ1IGluc2VydGlvbnMoKyksIDQ1IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCB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