Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5e41fb83216d370d158fe17675af82d12c6c72c9
Commit:     5e41fb83216d370d158fe17675af82d12c6c72c9
Parent:     9055e051b8d4b266054fe511a65a9888d30fa64f
Author:     Matthias Kaehlcke <[EMAIL PROTECTED]>
AuthorDate: Fri Dec 14 11:32:48 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:58:07 2008 -0800

    [PPP] synchronous tty: convert dead_sem to completion
    
    PPP synchronous tty channel driver: convert the semaphore dead_sem to a
    completion
    
    Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/ppp_synctty.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c
index f0c6a19..f7472c8 100644
--- a/drivers/net/ppp_synctty.c
+++ b/drivers/net/ppp_synctty.c
@@ -42,9 +42,9 @@
 #include <linux/if_ppp.h>
 #include <linux/ppp_channel.h>
 #include <linux/spinlock.h>
+#include <linux/completion.h>
 #include <linux/init.h>
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 
 #define PPP_VERSION    "2.4.2"
 
@@ -70,7 +70,7 @@ struct syncppp {
        struct tasklet_struct tsk;
 
        atomic_t        refcnt;
-       struct semaphore dead_sem;
+       struct completion dead_cmp;
        struct ppp_channel chan;        /* interface to generic ppp layer */
 };
 
@@ -195,7 +195,7 @@ static struct syncppp *sp_get(struct tty_struct *tty)
 static void sp_put(struct syncppp *ap)
 {
        if (atomic_dec_and_test(&ap->refcnt))
-               up(&ap->dead_sem);
+               complete(&ap->dead_cmp);
 }
 
 /*
@@ -225,7 +225,7 @@ ppp_sync_open(struct tty_struct *tty)
        tasklet_init(&ap->tsk, ppp_sync_process, (unsigned long) ap);
 
        atomic_set(&ap->refcnt, 1);
-       init_MUTEX_LOCKED(&ap->dead_sem);
+       init_completion(&ap->dead_cmp);
 
        ap->chan.private = ap;
        ap->chan.ops = &sync_ops;
@@ -273,7 +273,7 @@ ppp_sync_close(struct tty_struct *tty)
         * by the time it returns.
         */
        if (!atomic_dec_and_test(&ap->refcnt))
-               down(&ap->dead_sem);
+               wait_for_completion(&ap->dead_cmp);
        tasklet_kill(&ap->tsk);
 
        ppp_unregister_channel(&ap->chan);
-
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