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.76 #1 (Red Hat Linux)) id 1T9cTD-00015L-Ok for barebox@lists.infradead.org; Thu, 06 Sep 2012 13:50:12 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 6 Sep 2012 15:50:01 +0200 Message-Id: <1346939401-25611-1-git-send-email-u.kleine-koenig@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: [PATCH] [RFC] fec: fix calculation of mii bus speed on mxs To: barebox@lists.infradead.org Cc: kernel@pengutronix.de QWNjb3JkaW5nIHRvIGEgY29tbWVudCBpbiBMaW51eCcgZmVjIGRyaXZlciwgaS5NWDI4IHVzZXMg dGhlIHNhbWUKZm9ybXVsYSBmb3IgZGV0ZXJtaW5hdGlvbiBvZiB0aGUgZnJlcXVlbmN5IGRpdmlk ZXIgYXMgaS5NWDYsIHRoYXQgaXMKKGRpZmZlcmVudCBmcm9tIHRoZSBpLk1YMjggbWFudWFsKToK CglwYXJlbnQgY2xvY2sgLyAoKE1JSV9TUEVFRCArIDEpICogMikKCmluc3RlYWQgb2YKCglwYXJl bnQgY2xvY2sgLyAoTUlJX1NQRUVEICogMikKCm9uIHRoZSBvbGRlciBpLk1YIFNvQ3MuIEZpeCB0 aGUgY2FsY3VsYXRpb24gYWNjb3JkaW5nbHkuCgpTaWduZWQtb2ZmLWJ5OiBVd2UgS2xlaW5lLUvD tm5pZyA8dS5rbGVpbmUta29lbmlnQHBlbmd1dHJvbml4LmRlPgotLQpCdXQgbm90ZSB0aGF0IHRo aXMgZG9lc24ndCBmaXggYWNjZXNzaW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