Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1199434 > unrolled thread

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

Started byNicolas Boichat <drinkcat@chromium.org>
First post2015-08-04 08:20 +0200
Last post2015-08-04 13:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/3] spi: s3c24xx: Convert spinlock to mutex Nicolas Boichat <drinkcat@chromium.org> - 2015-08-04 08:20 +0200
    Re: [PATCH 3/3] spi: s3c24xx: Convert spinlock to mutex Mark Brown <broonie@kernel.org> - 2015-08-04 13:10 +0200

#1199434 — [PATCH 3/3] spi: s3c24xx: Convert spinlock to mutex

FromNicolas Boichat <drinkcat@chromium.org>
Date2015-08-04 08:20 +0200
Subject[PATCH 3/3] spi: s3c24xx: Convert spinlock to mutex
Message-ID<pTDJT-27d-1@gated-at.bofh.it>
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(-)

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;
 }
-- 
2.5.0.rc2.392.g76e840b

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1199671

FromMark Brown <broonie@kernel.org>
Date2015-08-04 13:10 +0200
Message-ID<pTIgz-h7-53@gated-at.bofh.it>
In reply to#1199434

[Multipart message — attachments visible in raw view] — view raw

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.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web