From fe16d6a6a48e41b0ef734ba6798c72126b6009eb Mon Sep 17 00:00:00 2001 From: David Brownell Date: Tue, 4 Dec 2007 23:45:09 -0800 Subject: [PATCH] --- yaml --- r: 74587 b: refs/heads/master c: 068f4070868c801c7d7aa1ae1193c1c854193545 h: refs/heads/master i: 74585: cfdf51b22aca1cd96aac43abe7b64eb0abd06817 74583: 2ba9f738980a6389ff6cf38866912755a9854dc9 v: v3 --- [refs] | 2 +- trunk/drivers/spi/spi.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index d1e84d3f1a39..26f5e40d2413 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f8fcc93319faa09272185af100fb24e71b02ab03 +refs/heads/master: 068f4070868c801c7d7aa1ae1193c1c854193545 diff --git a/trunk/drivers/spi/spi.c b/trunk/drivers/spi/spi.c index b31f4431849b..6ca07c9929e6 100644 --- a/trunk/drivers/spi/spi.c +++ b/trunk/drivers/spi/spi.c @@ -589,7 +589,7 @@ int spi_write_then_read(struct spi_device *spi, const u8 *txbuf, unsigned n_tx, u8 *rxbuf, unsigned n_rx) { - static DECLARE_MUTEX(lock); + static DEFINE_MUTEX(lock); int status; struct spi_message message; @@ -615,7 +615,7 @@ int spi_write_then_read(struct spi_device *spi, } /* ... unless someone else is using the pre-allocated buffer */ - if (down_trylock(&lock)) { + if (!mutex_trylock(&lock)) { local_buf = kmalloc(SPI_BUFSIZ, GFP_KERNEL); if (!local_buf) return -ENOMEM; @@ -634,7 +634,7 @@ int spi_write_then_read(struct spi_device *spi, } if (x[0].tx_buf == buf) - up(&lock); + mutex_unlock(&lock); else kfree(local_buf);