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.92 #3 (Red Hat Linux)) id 1i1uv1-0000Eb-Ji for barebox@lists.infradead.org; Sun, 25 Aug 2019 15:59:06 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Sun, 25 Aug 2019 17:58:41 +0200 Message-Id: <20190825155844.18455-5-u.kleine-koenig@pengutronix.de> In-Reply-To: <20190825155844.18455-1-u.kleine-koenig@pengutronix.de> References: <20190825155844.18455-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 v2 4/7] reset_source: implement helper to set a device as reset source To: barebox@lists.infradead.org VGhpcyBhbGxvd3MgdG8gcmVtb3ZlIHNvbWUgYm9pbGVycGxhdGUgZnJvbSBkcml2ZXJzLgoKU2ln bmVkLW9mZi1ieTogVXdlIEtsZWluZS1Lw7ZuaWcgPHUua2xlaW5lLWtvZW5pZ0BwZW5ndXRyb25p eC5kZT4KLS0tCiBjb21tb24vcmVzZXRfc291cmNlLmMgIHwgMjcgKysrKysrKysrKysrKysrKysr KysrKysrKy0tCiBpbmNsdWRlL3Jlc2V0X3NvdXJjZS5oIHwgIDIgKysKIDIgZmlsZXMgY2hhbmdl ZCwgMjcgaW5zZXJ0aW9ucygrKSwgMiBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9jb21tb24v cmVzZXRfc291cmNlLmMgYi9jb21tb24vcmVzZXRfc291cmNlLmMKaW5kZXggZjMyYjRlYWMyODE4 Li44ZmRmMDUyMTU3NTMgMTAwNjQ0Ci0tLSBhL2NvbW1vbi9yZXNldF9zb3VyY2UuYworKys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