Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=67837f232d6d55be99d6e0dec4ea9bb8112840cd
Commit:     67837f232d6d55be99d6e0dec4ea9bb8112840cd
Parent:     940408289842677cfe9e053a6c423bf3fb922560
Author:     Matthias Kaehlcke <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 17 04:04:16 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Jul 17 10:23:05 2007 -0700

    Use mutex instead of semaphore in CAPI 2.0 driver
    
    The CAPI 2.0 driver uses a semaphore as mutex.  Use the mutex API instead of
    the (binary) semaphore.
    
    Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]>
    Acked-by: Karsten Keil <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/isdn/capi/kcapi.c  |    6 +++---
 include/linux/kernelcapi.h |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c
index 3ed34f7..9f73bc2 100644
--- a/drivers/isdn/capi/kcapi.c
+++ b/drivers/isdn/capi/kcapi.c
@@ -258,7 +258,7 @@ static void recv_handler(struct work_struct *work)
        if ((!ap) || (ap->release_in_progress))
                return;
 
-       down(&ap->recv_sem);
+       mutex_lock(&ap->recv_mtx);
        while ((skb = skb_dequeue(&ap->recv_queue))) {
                if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_IND)
                        ap->nrecvdatapkt++;
@@ -267,7 +267,7 @@ static void recv_handler(struct work_struct *work)
 
                ap->recv_message(ap, skb);
        }
-       up(&ap->recv_sem);
+       mutex_unlock(&ap->recv_mtx);
 }
 
 void capi_ctr_handle_message(struct capi_ctr * card, u16 appl, struct sk_buff 
*skb)
@@ -547,7 +547,7 @@ u16 capi20_register(struct capi20_appl *ap)
        ap->nsentctlpkt = 0;
        ap->nsentdatapkt = 0;
        ap->callback = NULL;
-       init_MUTEX(&ap->recv_sem);
+       mutex_init(&ap->recv_mtx);
        skb_queue_head_init(&ap->recv_queue);
        INIT_WORK(&ap->recv_work, recv_handler);
        ap->release_in_progress = 0;
diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h
index aea34e7..8c4350a 100644
--- a/include/linux/kernelcapi.h
+++ b/include/linux/kernelcapi.h
@@ -64,7 +64,7 @@ struct capi20_appl {
        unsigned long nrecvdatapkt;
        unsigned long nsentctlpkt;
        unsigned long nsentdatapkt;
-       struct semaphore recv_sem;
+       struct mutex recv_mtx;
        struct sk_buff_head recv_queue;
        struct work_struct recv_work;
        int release_in_progress;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to