Commit b6e47e97 authored by Thomas Gleixner's avatar Thomas Gleixner

net: ppp_async: Convert to anon_semaphore

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent d41f9a85
...@@ -67,7 +67,7 @@ struct asyncppp { ...@@ -67,7 +67,7 @@ struct asyncppp {
struct tasklet_struct tsk; struct tasklet_struct tsk;
atomic_t refcnt; atomic_t refcnt;
struct semaphore dead_sem; struct anon_semaphore dead_sem;
struct ppp_channel chan; /* interface to generic ppp layer */ struct ppp_channel chan; /* interface to generic ppp layer */
unsigned char obuf[OBUFSIZE]; unsigned char obuf[OBUFSIZE];
}; };
...@@ -145,7 +145,7 @@ static struct asyncppp *ap_get(struct tty_struct *tty) ...@@ -145,7 +145,7 @@ static struct asyncppp *ap_get(struct tty_struct *tty)
static void ap_put(struct asyncppp *ap) static void ap_put(struct asyncppp *ap)
{ {
if (atomic_dec_and_test(&ap->refcnt)) if (atomic_dec_and_test(&ap->refcnt))
up(&ap->dead_sem); anon_up(&ap->dead_sem);
} }
/* /*
...@@ -183,7 +183,7 @@ ppp_asynctty_open(struct tty_struct *tty) ...@@ -183,7 +183,7 @@ ppp_asynctty_open(struct tty_struct *tty)
tasklet_init(&ap->tsk, ppp_async_process, (unsigned long) ap); tasklet_init(&ap->tsk, ppp_async_process, (unsigned long) ap);
atomic_set(&ap->refcnt, 1); atomic_set(&ap->refcnt, 1);
semaphore_init_locked(&ap->dead_sem); anon_semaphore_init_locked(&ap->dead_sem);
ap->chan.private = ap; ap->chan.private = ap;
ap->chan.ops = &async_ops; ap->chan.ops = &async_ops;
...@@ -232,7 +232,7 @@ ppp_asynctty_close(struct tty_struct *tty) ...@@ -232,7 +232,7 @@ ppp_asynctty_close(struct tty_struct *tty)
* by the time it returns. * by the time it returns.
*/ */
if (!atomic_dec_and_test(&ap->refcnt)) if (!atomic_dec_and_test(&ap->refcnt))
down(&ap->dead_sem); anon_down(&ap->dead_sem);
tasklet_kill(&ap->tsk); tasklet_kill(&ap->tsk);
ppp_unregister_channel(&ap->chan); ppp_unregister_channel(&ap->chan);
......
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