From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eHSBO-0007Go-9U for barebox@lists.infradead.org; Wed, 22 Nov 2017 10:23:11 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 22 Nov 2017 11:22:31 +0100 Message-Id: <20171122102231.16872-7-u.kleine-koenig@pengutronix.de> In-Reply-To: <20171122102231.16872-1-u.kleine-koenig@pengutronix.de> References: <20171122102231.16872-1-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" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 6/6] net/e1000: provide device for accessing emulated eeprom To: barebox@lists.infradead.org Cc: Andrey Smirnov VGhpcyBkZXZpY2UgdXNlcyBlMTAwMF9yZWFkX2VlcHJvbSB0byBwcm92aWRlIGFjY2VzcyB0byB0 aGUgZW11bGF0ZWQKZWVwcm9tIG9uIGUxMDAwLWlnYi4gT25seSByZWFkaW5nIGlzIGltcGxlbWVu dGVkIGZvciBub3cuCgpTaWduZWQtb2ZmLWJ5OiBVd2UgS2xlaW5lLUvDtm5pZyA8dS5rbGVpbmUt a29lbmlnQHBlbmd1dHJvbml4LmRlPgotLS0KIGRyaXZlcnMvbmV0L2UxMDAwL2UxMDAwLmggIHwg IDIgKysKIGRyaXZlcnMvbmV0L2UxMDAwL2VlcHJvbS5jIHwgNDMgKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrKysrKysrLQogMiBmaWxlcyBjaGFuZ2VkLCA0NCBpbnNlcnRpb25z KCspLCAxIGRlbGV0aW9uKC0pCgpkaWZmIC0tZ2l0IGEvZHJpdmVycy9uZXQvZT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