From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.phytec.eu ([217.6.246.34] helo=root.phytec.de) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XlGo6-0003X0-3d for barebox@lists.infradead.org; Mon, 03 Nov 2014 12:32:27 +0000 Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id C7441A0018C for ; Mon, 3 Nov 2014 13:32:11 +0100 (CET) From: =?UTF-8?q?Teresa=20G=C3=A1mez?= Date: Mon, 3 Nov 2014 13:31:52 +0100 Message-Id: <1415017914-43444-1-git-send-email-t.gamez@phytec.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: [PATCHv2 1/3] of: Add of_device_enable_and_register functions To: barebox@lists.infradead.org RnVuY3Rpb24gdG8gZW5hYmxlIGFuZCByZWdpc3RlciBhIGRpc2FibGVkIGRldmljZS4KVGhlIGRl dmljZXMgY2FuIGJlIHJlZ2lzdGVyZWQgdXNpbmcgdGhlCmRldmljZSBub2RlIHdpdGggb2ZfZGV2 aWNlX2VuYWJsZV9hbmRfcmVnaXN0ZXIoKSBvcgp3aXRoIHRoZSBkZXZpY2Ugbm9kZSBuYW1lL3Bh dGggYnkgdXNpbmcgdGhlCm9mX2RldmljZV9lbmFibGVfYW5kX3JlZ2lzdGVyX2J5X25hbWUoKSBm dW5jdGlvbi4KClNpZ25lZC1vZmYtYnk6IFRlcmVzYSBHw6FtZXogPHQuZ2FtZXpAcGh5dGVjLmRl PgotLS0KdjI6Ci0gcmVuYW1lZCBmdW5jdGlvbnMKCiBkcml2ZXJzL29mL3BsYXRmb3JtLmMgfCA0 MyArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrCiBpbm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