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 1cEvpB-0001le-Fv for barebox@lists.infradead.org; Thu, 08 Dec 2016 10:21:14 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 8 Dec 2016 11:20:50 +0100 Message-Id: <20161208102050.7617-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] spi: mvebu: use wait_on_timeout instead of a loop with udelay. To: barebox@lists.infradead.org VGhpcyBsb29rcyBuaWNlciBhbmQgcmVkdWNlcyB0aGUgdGltZSB0byB0cmFuc2ZlciA0MCBNQiBh dCA1MCBNSHogZnJvbQoyMDMgc2Vjb25kcyB0byA4NyBzZWNvbmRzLgoKU2lnbmVkLW9mZi1ieTog VXdlIEtsZWluZS1Lw7ZuaWcgPHUua2xlaW5lLWtvZW5pZ0BwZW5ndXRyb25peC5kZT4KLS0tClNp ZGUgbm90ZToKCldoZW4gdXNpbmcKCgl3aGlsZSghKHJlYWRsKHAtPmJhc2UgKyBTUElfSUZfQ1RS TCkgJiBJRl9SRUFEX1JFQURZKSkKCQk7CglyZXR1cm4gMDsKCmluc3RlYWQsIHRoZSB0aW1lIGdv ZXMgZG93biB0byAyNCBzZWNvbmRzLgoKSSB0aGluayB0aGUgY3VscHJpdCBpcyB0aGF0IGdldF90 aW1lX25zICh3aGljaCBpcyB1c2VkIGluCndhaXRfb25fdGltZW91dCkgaGFuZGxlcyBjb252ZXJz aW9uIGZyb20gdGltZXIgdmFsdWVzIHRvIG5zLgoKSSBkaWRuJ3QgbG9vayBpbnRvIH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