[ALSA] semaphore -> mutex (driver part)
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
committed by
Jaroslav Kysela
parent
1a60d4c5a0
commit
ef9f0a42db
@@ -18,6 +18,7 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <linux/mutex.h>
|
||||
#include <sound/driver.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/slab.h>
|
||||
@@ -42,7 +43,7 @@ snd_util_memhdr_new(int memsize)
|
||||
if (hdr == NULL)
|
||||
return NULL;
|
||||
hdr->size = memsize;
|
||||
init_MUTEX(&hdr->block_mutex);
|
||||
mutex_init(&hdr->block_mutex);
|
||||
INIT_LIST_HEAD(&hdr->block);
|
||||
|
||||
return hdr;
|
||||
@@ -136,9 +137,9 @@ struct snd_util_memblk *
|
||||
snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size)
|
||||
{
|
||||
struct snd_util_memblk *blk;
|
||||
down(&hdr->block_mutex);
|
||||
mutex_lock(&hdr->block_mutex);
|
||||
blk = __snd_util_mem_alloc(hdr, size);
|
||||
up(&hdr->block_mutex);
|
||||
mutex_unlock(&hdr->block_mutex);
|
||||
return blk;
|
||||
}
|
||||
|
||||
@@ -163,9 +164,9 @@ int snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk)
|
||||
{
|
||||
snd_assert(hdr && blk, return -EINVAL);
|
||||
|
||||
down(&hdr->block_mutex);
|
||||
mutex_lock(&hdr->block_mutex);
|
||||
__snd_util_mem_free(hdr, blk);
|
||||
up(&hdr->block_mutex);
|
||||
mutex_unlock(&hdr->block_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -175,9 +176,9 @@ int snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk)
|
||||
int snd_util_mem_avail(struct snd_util_memhdr *hdr)
|
||||
{
|
||||
unsigned int size;
|
||||
down(&hdr->block_mutex);
|
||||
mutex_lock(&hdr->block_mutex);
|
||||
size = hdr->size - hdr->used;
|
||||
up(&hdr->block_mutex);
|
||||
mutex_unlock(&hdr->block_mutex);
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user