From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.x-arc.co.uk ([217.6.246.34] helo=root.phytec.de) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XYvPb-0001U9-Fe for barebox@lists.infradead.org; Tue, 30 Sep 2014 11:16:08 +0000 Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id DB67CA0018C for ; Tue, 30 Sep 2014 13:15:51 +0200 (CEST) From: =?UTF-8?q?Teresa=20G=C3=A1mez?= Date: Tue, 30 Sep 2014 13:15:27 +0200 Message-Id: <1412075730-5946-2-git-send-email-t.gamez@phytec.de> In-Reply-To: <1412075730-5946-1-git-send-email-t.gamez@phytec.de> References: <1412075730-5946-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: [PATCHv3 2/5] of: base: Add of_find_node_by_phandle_from To: barebox@lists.infradead.org QWRkZWQgb2ZfZmluZF9ub2RlX2J5X3BoYW5kbGVfZnJvbSgpIHRvIGZpbmQgbm9kZXMgYnkKcGhh bmRsZSB3aXRoIGEgZ2l2ZW4gcm9vdCBub2RlLgoKU2lnbmVkLW9mZi1ieTogVGVyZXNhIEfDoW1l eiA8dC5nYW1lekBwaHl0ZWMuZGU+Ci0tLQogZHJpdmVycy9vZi9iYXNlLmMgfCAyOCArKysrKysr KysrKysrKysrKysrKysrKystLS0tCiBpbmNsdWRlL29mLmggICAgICB8ICA4ICsrKysrKysrCiAy IGZpbGVzIGNoYW5nZWQsIDMyIGluc2VydGlvbnMoKyksIDQgZGVsZXRpb25zKC0pCgpkaWZmIC0t Z2l0IGEvZHJpdmVycy9vZi9iYXNlLmMgYi9kcml2ZXJzL29mL2Jhc2UuYwppbmR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