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 1ZoSSE-0001CR-Rk for barebox@lists.infradead.org; Tue, 20 Oct 2015 08:39:37 +0000 From: Marc Kleine-Budde Date: Tue, 20 Oct 2015 10:39:07 +0200 Message-Id: <1445330352-30153-4-git-send-email-mkl@pengutronix.de> In-Reply-To: <1445330352-30153-1-git-send-email-mkl@pengutronix.de> References: <1445330352-30153-1-git-send-email-mkl@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 v2 3/8] state: make use of of_find_path_by_phandle() and add return -EPROBE_DEFER if device is not available To: barebox@lists.infradead.org Cc: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= U2lnbmVkLW9mZi1ieTogVXdlIEtsZWluZS1Lw7ZuaWcgPHUua2xlaW5lLWtvZW5pZ0BwZW5ndXRy b25peC5kZT4KU2lnbmVkLW9mZi1ieTogTWFyYyBLbGVpbmUtQnVkZGUgPG1rbEBwZW5ndXRyb25p eC5kZT4KLS0tCiBkcml2ZXJzL21pc2Mvc3RhdGUuYyB8IDM3ICsrKysrKysrLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0KIDEgZmlsZSBjaGFuZ2VkLCA4IGluc2VydGlvbnMoKyksIDI5IGRl bGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2RyaXZlcnMvbWlzYy9zdGF0ZS5jIGIvZHJpdmVycy9t aXNjL3N0YXRlLmMKaW5kZXggZjNlMzY2NDgwZmEyLi40Y2RhNTViNmVmYzYgMTAwNjQ0Ci0tLSBh L2RyaXZlcnMvbWlzYy9zdG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