From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp3-g21.free.fr ([2a01:e0c:1:1599::12]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T9hvV-0001Ha-7r for barebox@lists.infradead.org; Thu, 06 Sep 2012 19:39:46 +0000 Received: from localhost.localdomain (unknown [82.233.81.124]) by smtp3-g21.free.fr (Postfix) with ESMTP id 12B6AA6168 for ; Thu, 6 Sep 2012 21:39:39 +0200 (CEST) From: =?UTF-8?q?Eric=20B=C3=A9nard?= Date: Thu, 6 Sep 2012 21:39:31 +0200 Message-Id: <1346960371-4129-3-git-send-email-eric@eukrea.com> In-Reply-To: <1346960371-4129-1-git-send-email-eric@eukrea.com> References: <1346960371-4129-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 3/3] miidev: fix 1G wrong detection To: barebox@lists.infradead.org c2luY2UgOTllNzJjOGJiZGJkYzY5MDAyNWE1ODY4ZDgzMWYxZmU3OWFkNTZmYyBvbiBhbiBpLk1Y NTEgYmFzZWQgYm9hcmQsCkkgZ2V0IDogInBoeTA6IExpbmsgaXMgdXAgLSAxMDAwL0Z1bGwiLiBJ dCBzZWVtcyBtaWlkZXYgdHJpZXMgdG8gcHJvYmUKdGhlIFBIWSB0byBlYXJseSBhbmQgZ2V0cyAw eDNmZmZmIHdoaWNoIGxlYWRzIHRvIHRoZSB3cm9uZyBjYXBhYmlsaXRpZXMKc2V0dGluZy4KClNp Z25lZC1vZmYtYnk6IEVyaWMgQsOpbmFyZCA8ZXJpY0BldWtyZWEuY29tPgotLS0KIGRyaXZlcnMv bmV0L21paWRldi5jIHwgICAzMyArKysrKysrKystLS0tLS0tLS0tLS0tLS0tLS0tL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