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.80.1 #2 (Red Hat Linux)) id 1b7JgP-000325-Sl for barebox@lists.infradead.org; Mon, 30 May 2016 09:40:26 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 30 May 2016 11:39:53 +0200 Message-Id: <1464601193-20832-3-git-send-email-u.kleine-koenig@pengutronix.de> In-Reply-To: <1464601193-20832-1-git-send-email-u.kleine-koenig@pengutronix.de> References: <1464601193-20832-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" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 3/3] eeprom: at24: make device name setup more robust To: barebox@lists.infradead.org V2l0aCB0d28gZWVwcm9tcyB0aGF0IGhhdmUgYSBkaWZmZXJlbnQgY29tcGF0aWJsZSBzdHJpbmcg KGluIG15IGNhc2UKImF0LDI0YzY0IiBhbmQgImF0LDI0YzMyIikgZGV2LT5pZCBpcyAwIGZvciBi b3RoIHdoaWNoIHJlc3VsdHMgaW4gYQpmYWlsdXJlIHRvIGJpbmQgdGhlIGRldmljZSB0aGF0IGlz IHByb2JlZCBsYXRlci4KClNvIHBpY2sgYSBuYW1lIG1vcmUgaW50ZWxsaWdlbnRseTogSWYgdGhl cmUgaXMgYW4gYWxpYXMgZGVmaW5lZCBpbiB0aGUKZGV2aWNlIHRyZWUsIHVzZSB0aGlzIG9uZSwg b3RoZXJ3aXNlIHBpY2sgYSBmcmVlIGluZGV4LgoKU2lnbmVkLW9mZi1ieTogVXdlIEtsZWluZS1L w7ZuaWcgPHUua2xlaW5lLWtvZW5pZ0BwZW5ndXRyb25peC5kZT4KLS0tC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