aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ppp_synctty.c
diff options
context:
space:
mode:
authorMatthias Kaehlcke <matthias.kaehlcke@gmail.com>2007-12-14 14:32:48 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:58:07 -0500
commit5e41fb83216d370d158fe17675af82d12c6c72c9 (patch)
treeea489e2de903ed378b5d8aa0b1b235693df431f5 /drivers/net/ppp_synctty.c
parent9055e051b8d4b266054fe511a65a9888d30fa64f (diff)
[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 <matthias.kaehlcke@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ppp_synctty.c')
-rw-r--r--drivers/net/ppp_synctty.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c
index f0c6a1926a02..f7472c8505f0 100644
--- a/drivers/net/ppp_synctty.c
+++ b/drivers/net/ppp_synctty.c
@@ -42,9 +42,9 @@
42#include <linux/if_ppp.h> 42#include <linux/if_ppp.h>
43#include <linux/ppp_channel.h> 43#include <linux/ppp_channel.h>
44#include <linux/spinlock.h> 44#include <linux/spinlock.h>
45#include <linux/completion.h>
45#include <linux/init.h> 46#include <linux/init.h>
46#include <asm/uaccess.h> 47#include <asm/uaccess.h>
47#include <asm/semaphore.h>
48 48
49#define PPP_VERSION "2.4.2" 49#define PPP_VERSION "2.4.2"
50 50
@@ -70,7 +70,7 @@ struct syncppp {
70 struct tasklet_struct tsk; 70 struct tasklet_struct tsk;
71 71
72 atomic_t refcnt; 72 atomic_t refcnt;
73 struct semaphore dead_sem; 73 struct completion dead_cmp;
74 struct ppp_channel chan; /* interface to generic ppp layer */ 74 struct ppp_channel chan; /* interface to generic ppp layer */
75}; 75};
76 76
@@ -195,7 +195,7 @@ static struct syncppp *sp_get(struct tty_struct *tty)
195static void sp_put(struct syncppp *ap) 195static void sp_put(struct syncppp *ap)
196{ 196{
197 if (atomic_dec_and_test(&ap->refcnt)) 197 if (atomic_dec_and_test(&ap->refcnt))
198 up(&ap->dead_sem); 198 complete(&ap->dead_cmp);
199} 199}
200 200
201/* 201/*
@@ -225,7 +225,7 @@ ppp_sync_open(struct tty_struct *tty)
225 tasklet_init(&ap->tsk, ppp_sync_process, (unsigned long) ap); 225 tasklet_init(&ap->tsk, ppp_sync_process, (unsigned long) ap);
226 226
227 atomic_set(&ap->refcnt, 1); 227 atomic_set(&ap->refcnt, 1);
228 init_MUTEX_LOCKED(&ap->dead_sem); 228 init_completion(&ap->dead_cmp);
229 229
230 ap->chan.private = ap; 230 ap->chan.private = ap;
231 ap->chan.ops = &sync_ops; 231 ap->chan.ops = &sync_ops;
@@ -273,7 +273,7 @@ ppp_sync_close(struct tty_struct *tty)
273 * by the time it returns. 273 * by the time it returns.
274 */ 274 */
275 if (!atomic_dec_and_test(&ap->refcnt)) 275 if (!atomic_dec_and_test(&ap->refcnt))
276 down(&ap->dead_sem); 276 wait_for_completion(&ap->dead_cmp);
277 tasklet_kill(&ap->tsk); 277 tasklet_kill(&ap->tsk);
278 278
279 ppp_unregister_channel(&ap->chan); 279 ppp_unregister_channel(&ap->chan);