Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304225
b: refs/heads/master
c: 1541f84
h: refs/heads/master
i:
  304223: 13972be
v: v3
  • Loading branch information
Ivo Sieben authored and Greg Kroah-Hartman committed May 10, 2012
1 parent e97690c commit c920dfa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3e62c413fb0c75c8cfaf086d00a9ecc6b55009d6
refs/heads/master: 1541f845d123a48fbca3cee32b2963b3fb3da83a
7 changes: 4 additions & 3 deletions trunk/drivers/tty/tty_ldisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

static DEFINE_SPINLOCK(tty_ldisc_lock);
static DECLARE_WAIT_QUEUE_HEAD(tty_ldisc_wait);
static DECLARE_WAIT_QUEUE_HEAD(tty_ldisc_idle);
/* Line disc dispatch table */
static struct tty_ldisc_ops *tty_ldiscs[NR_LDISCS];

Expand Down Expand Up @@ -65,7 +64,7 @@ static void put_ldisc(struct tty_ldisc *ld)
return;
}
local_irq_restore(flags);
wake_up(&tty_ldisc_idle);
wake_up(&ld->wq_idle);
}

/**
Expand Down Expand Up @@ -200,6 +199,8 @@ static struct tty_ldisc *tty_ldisc_get(int disc)

ld->ops = ldops;
atomic_set(&ld->users, 1);
init_waitqueue_head(&ld->wq_idle);

return ld;
}

Expand Down Expand Up @@ -538,7 +539,7 @@ static void tty_ldisc_flush_works(struct tty_struct *tty)
static int tty_ldisc_wait_idle(struct tty_struct *tty, long timeout)
{
long ret;
ret = wait_event_timeout(tty_ldisc_idle,
ret = wait_event_timeout(tty->ldisc->wq_idle,
atomic_read(&tty->ldisc->users) == 1, timeout);
return ret > 0 ? 0 : -EBUSY;
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/tty_ldisc.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
#include <linux/fs.h>
#include <linux/wait.h>
#include <linux/pps_kernel.h>
#include <linux/wait.h>

struct tty_ldisc_ops {
int magic;
Expand Down Expand Up @@ -154,6 +155,7 @@ struct tty_ldisc_ops {
struct tty_ldisc {
struct tty_ldisc_ops *ops;
atomic_t users;
wait_queue_head_t wq_idle;
};

#define TTY_LDISC_MAGIC 0x5403
Expand Down

0 comments on commit c920dfa

Please sign in to comment.