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.87 #1 (Red Hat Linux)) id 1dczUW-0005v9-6Q for barebox@lists.infradead.org; Wed, 02 Aug 2017 19:39:37 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 2 Aug 2017 21:39:07 +0200 Message-Id: <20170802193907.4317-3-u.kleine-koenig@pengutronix.de> In-Reply-To: <20170802193907.4317-1-u.kleine-koenig@pengutronix.de> References: <20170802193907.4317-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 2/2] spi: imx: add timeout to xchg_single To: barebox@lists.infradead.org SWYgdGhlcmUgaXMgYSBwcm9ibGVtIFNUQVRfUlIgbWlnaHQgbmV2ZXIgYmUgc2V0IHdoaWNoIHJl c3VsdHMgaW4gYW4gZW5kbGVzcyBsb29wLgpCcmVhayBvdXQgYWZ0ZXIgMTAgwrVzIHdpdGggLUVU SU1FT1VUIGluc3RlYWQuCgpTaWduZWQtb2ZmLWJ5OiBVd2UgS2xlaW5lLUvDtm5pZyA8dS5rbGVp bmUta29lbmlnQHBlbmd1dHJvbml4LmRlPgotLS0KIGRyaXZlcnMvc3BpL2lteF9zcGkuYyB8IDI4 ICsrKysrKysrKysrKysrKysrKysrKysrKy0tLS0KIDEgZmlsZSBjaGFuZ2VkLCAyNCBpbnNlcnRp b25zKCspLCA0IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2RyaXZlcnMvc3BpL2lteF9zcGku YyBiL2RyaXZlcnMvc3BpL2lteF9zcGkuYwppbmRleCA5N2EyMDkxOTY5ZGQuLjc4MTk4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