Commit d41f9a85 authored by Thomas Gleixner's avatar Thomas Gleixner

hamradio: Convert to anon_semaphore

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 0d90b99b
......@@ -120,7 +120,7 @@ struct sixpack {
struct timer_list tx_t;
struct timer_list resync_t;
atomic_t refcnt;
struct semaphore dead_sem;
struct anon_semaphore dead_sem;
spinlock_t lock;
};
......@@ -412,7 +412,7 @@ static struct sixpack *sp_get(struct tty_struct *tty)
static void sp_put(struct sixpack *sp)
{
if (atomic_dec_and_test(&sp->refcnt))
up(&sp->dead_sem);
anon_up(&sp->dead_sem);
}
/*
......@@ -606,7 +606,7 @@ static int sixpack_open(struct tty_struct *tty)
spin_lock_init(&sp->lock);
atomic_set(&sp->refcnt, 1);
semaphore_init_locked(&sp->dead_sem);
anon_semaphore_init_locked(&sp->dead_sem);
/* !!! length of the buffers. MTU is IP MTU, not PACLEN! */
......@@ -702,7 +702,7 @@ static void sixpack_close(struct tty_struct *tty)
* we have to wait for all existing users to finish.
*/
if (!atomic_dec_and_test(&sp->refcnt))
down(&sp->dead_sem);
anon_down(&sp->dead_sem);
unregister_netdev(sp->dev);
......
......@@ -82,7 +82,7 @@ struct mkiss {
#define CRC_MODE_SMACK_TEST 4
atomic_t refcnt;
struct semaphore dead_sem;
struct anon_semaphore dead_sem;
};
/*---------------------------------------------------------------------------*/
......@@ -718,7 +718,7 @@ static struct mkiss *mkiss_get(struct tty_struct *tty)
static void mkiss_put(struct mkiss *ax)
{
if (atomic_dec_and_test(&ax->refcnt))
up(&ax->dead_sem);
anon_up(&ax->dead_sem);
}
static int crc_force = 0; /* Can be overridden with insmod */
......@@ -745,7 +745,7 @@ static int mkiss_open(struct tty_struct *tty)
spin_lock_init(&ax->buflock);
atomic_set(&ax->refcnt, 1);
semaphore_init_locked(&ax->dead_sem);
anon_semaphore_init_locked(&ax->dead_sem);
ax->tty = tty;
tty->disc_data = ax;
......@@ -824,7 +824,7 @@ static void mkiss_close(struct tty_struct *tty)
* we have to wait for all existing users to finish.
*/
if (!atomic_dec_and_test(&ax->refcnt))
down(&ax->dead_sem);
anon_down(&ax->dead_sem);
unregister_netdev(ax->dev);
......
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