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.85_2 #1 (Red Hat Linux)) id 1c6zBK-0007OJ-IY for barebox@lists.infradead.org; Wed, 16 Nov 2016 12:19:15 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 16 Nov 2016 13:18:49 +0100 Message-Id: <20161116121851.12399-1-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 1/3] i2c: gpio: fix handling of return code of of_get_gpio To: barebox@lists.infradead.org SW5zdGVhZCBvZiB1c2luZyBncGlvX2lzX3ZhbGlkIGp1c3QgY2hlY2sgdGhlIHJldHVybiBjb2Rl IG9mIG9mX2dldF9ncGlvCmZvciBiZWluZyA8IDAuIFRoaXMgZml4ZXMgLUVQUk9CRV9ERUZFUiBo YW5kbGluZyBhcyBub3cgdGhpcyBlcnJvciBjb2RlCmlzIGhhbmRlZCB0byB0aGUgY2FsbGVyIGlu c3RlYWQgb2YgLUVOT0RFVi4gSWYgdGhlIGdwaW8gcmV0dXJuZWQgYnkKb2ZfZ2V0X2dwaW8gaXMg YW4gaW52YWxpZCBudW1iZXIgdGhpcyBpc24ndCBub3RpY2VkIGJ5Cm9mX2kyY19ncGlvX3Byb2Jl LCBidXQgdGhlbiBncGlvX3JlcXVlc3QgbGF0ZXIgZmFpbHMgd2hpY2ggaXMgZ29vZAplbm91Z2gu CgpTaWduZWQtb2ZmLWJ5OiBVd2UgS2xlaW5lLUvDtm5pZyA8dS5rbGVpbmUta29lbmlnQHBlbmd1 dHJvbml4LmRlPgotLS0KIGRyaXZlcnMvaTJjL2J1c3Nlcy9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