diff mbox

[3/3] spi: s3c24xx: Convert spinlock to mutex

Message ID 1438668598-6678-3-git-send-email-drinkcat@chromium.org (mailing list archive)
State New, archived
Headers show

Commit Message

Nicolas Boichat Aug. 4, 2015, 6:09 a.m. UTC
bitbang->lock is now a mutex: replace spinlock function calls
by mutex functions.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
---
 drivers/spi/spi-s3c24xx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Mark Brown Aug. 4, 2015, 11 a.m. UTC | #1
On Tue, Aug 04, 2015 at 02:09:58PM +0800, Nicolas Boichat wrote:
> bitbang->lock is now a mutex: replace spinlock function calls
> by mutex functions.

This would need to be combined with the first patch, individual patches
shouldn't break the build.
diff mbox

Patch

diff --git a/drivers/spi/spi-s3c24xx.c b/drivers/spi/spi-s3c24xx.c
index f36bc32..b1d03e5 100644
--- a/drivers/spi/spi-s3c24xx.c
+++ b/drivers/spi/spi-s3c24xx.c
@@ -198,12 +198,11 @@  static int s3c24xx_spi_setup(struct spi_device *spi)
 	if (ret)
 		return ret;
 
-	spin_lock(&hw->bitbang.lock);
-	if (!hw->bitbang.busy) {
+	if (mutex_trylock(&hw->bitbang.lock)) {
 		hw->bitbang.chipselect(spi, BITBANG_CS_INACTIVE);
 		/* need to ndelay for 0.5 clocktick ? */
+		mutex_unlock(&hw->bitbang.lock);
 	}
-	spin_unlock(&hw->bitbang.lock);
 
 	return 0;
 }