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 1ZqSSN-0008Ev-Dn for barebox@lists.infradead.org; Sun, 25 Oct 2015 21:04:00 +0000 From: Marc Kleine-Budde Date: Sun, 25 Oct 2015 22:03:30 +0100 Message-Id: <1445807016-6637-4-git-send-email-mkl@pengutronix.de> In-Reply-To: <1445807016-6637-1-git-send-email-mkl@pengutronix.de> References: <1445807016-6637-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 v3 3/9] state: make use of of_find_path_by_node() 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 eC5kZT4KLS0tCiBkcml2ZXJzL21pc2Mvc3RhdGUuYyB8IDMxICsrKysrKysrKy0tLS0tLS0tLS0t LS0tLS0tLS0tLS0KIDEgZmlsZSBjaGFuZ2VkLCA5IGluc2VydGlvbnMoKyksIDIyIGRlbGV0aW9u cygtKQoKZGlmZiAtLWdpdCBhL2RyaXZlcnMvbWlzYy9zdGF0ZS5jIGIvZHJpdmVycy9taXNjL3N0 YXRlLmMKaW5kZXggZjNlMzY2NDgwZmEyLi4yMjU1MTQ3OGU2NTEgMTAwNjQ0Ci0tLSBhL2RyaXZl cnMvbWlzYy9zdGF0ZS5jC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