Commit 9cdf1827 authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Linus Torvalds

[PATCH] sem2mutex: kcapi.c

Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: default avatarArjan van de Ven <arjan@infradead.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Cc: Karsten Keil <kkeil@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4f7a07b8
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#ifdef CONFIG_AVMB1_COMPAT #ifdef CONFIG_AVMB1_COMPAT
#include <linux/b1lli.h> #include <linux/b1lli.h>
#endif #endif
#include <linux/mutex.h>
static char *revision = "$Revision: 1.1.2.8 $"; static char *revision = "$Revision: 1.1.2.8 $";
...@@ -66,7 +67,7 @@ LIST_HEAD(capi_drivers); ...@@ -66,7 +67,7 @@ LIST_HEAD(capi_drivers);
DEFINE_RWLOCK(capi_drivers_list_lock); DEFINE_RWLOCK(capi_drivers_list_lock);
static DEFINE_RWLOCK(application_lock); static DEFINE_RWLOCK(application_lock);
static DECLARE_MUTEX(controller_sem); static DEFINE_MUTEX(controller_mutex);
struct capi20_appl *capi_applications[CAPI_MAXAPPL]; struct capi20_appl *capi_applications[CAPI_MAXAPPL];
struct capi_ctr *capi_cards[CAPI_MAXCONTR]; struct capi_ctr *capi_cards[CAPI_MAXCONTR];
...@@ -395,20 +396,20 @@ attach_capi_ctr(struct capi_ctr *card) ...@@ -395,20 +396,20 @@ attach_capi_ctr(struct capi_ctr *card)
{ {
int i; int i;
down(&controller_sem); mutex_lock(&controller_mutex);
for (i = 0; i < CAPI_MAXCONTR; i++) { for (i = 0; i < CAPI_MAXCONTR; i++) {
if (capi_cards[i] == NULL) if (capi_cards[i] == NULL)
break; break;
} }
if (i == CAPI_MAXCONTR) { if (i == CAPI_MAXCONTR) {
up(&controller_sem); mutex_unlock(&controller_mutex);
printk(KERN_ERR "kcapi: out of controller slots\n"); printk(KERN_ERR "kcapi: out of controller slots\n");
return -EBUSY; return -EBUSY;
} }
capi_cards[i] = card; capi_cards[i] = card;
up(&controller_sem); mutex_unlock(&controller_mutex);
card->nrecvctlpkt = 0; card->nrecvctlpkt = 0;
card->nrecvdatapkt = 0; card->nrecvdatapkt = 0;
...@@ -531,13 +532,13 @@ u16 capi20_register(struct capi20_appl *ap) ...@@ -531,13 +532,13 @@ u16 capi20_register(struct capi20_appl *ap)
write_unlock_irqrestore(&application_lock, flags); write_unlock_irqrestore(&application_lock, flags);
down(&controller_sem); mutex_lock(&controller_mutex);
for (i = 0; i < CAPI_MAXCONTR; i++) { for (i = 0; i < CAPI_MAXCONTR; i++) {
if (!capi_cards[i] || capi_cards[i]->cardstate != CARD_RUNNING) if (!capi_cards[i] || capi_cards[i]->cardstate != CARD_RUNNING)
continue; continue;
register_appl(capi_cards[i], applid, &ap->rparam); register_appl(capi_cards[i], applid, &ap->rparam);
} }
up(&controller_sem); mutex_unlock(&controller_mutex);
if (showcapimsgs & 1) { if (showcapimsgs & 1) {
printk(KERN_DEBUG "kcapi: appl %d up\n", applid); printk(KERN_DEBUG "kcapi: appl %d up\n", applid);
...@@ -560,13 +561,13 @@ u16 capi20_release(struct capi20_appl *ap) ...@@ -560,13 +561,13 @@ u16 capi20_release(struct capi20_appl *ap)
capi_applications[ap->applid - 1] = NULL; capi_applications[ap->applid - 1] = NULL;
write_unlock_irqrestore(&application_lock, flags); write_unlock_irqrestore(&application_lock, flags);
down(&controller_sem); mutex_lock(&controller_mutex);
for (i = 0; i < CAPI_MAXCONTR; i++) { for (i = 0; i < CAPI_MAXCONTR; i++) {
if (!capi_cards[i] || capi_cards[i]->cardstate != CARD_RUNNING) if (!capi_cards[i] || capi_cards[i]->cardstate != CARD_RUNNING)
continue; continue;
release_appl(capi_cards[i], ap->applid); release_appl(capi_cards[i], ap->applid);
} }
up(&controller_sem); mutex_unlock(&controller_mutex);
flush_scheduled_work(); flush_scheduled_work();
skb_queue_purge(&ap->recv_queue); skb_queue_purge(&ap->recv_queue);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment