Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54618
b: refs/heads/master
c: ca509f6
h: refs/heads/master
v: v3
  • Loading branch information
Alexey Dobriyan authored and Linus Torvalds committed May 8, 2007
1 parent de2b9a1 commit aa83a53
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 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: ef51c97623b94f51e439ac91d2736aab3d1b6594
refs/heads/master: ca509f69dec7fa564005aa7e9fcf0cd46de3f7d6
5 changes: 4 additions & 1 deletion trunk/drivers/char/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3770,7 +3770,9 @@ int tty_register_driver(struct tty_driver *driver)
if (!driver->put_char)
driver->put_char = tty_default_put_char;

mutex_lock(&tty_mutex);
list_add(&driver->tty_drivers, &tty_drivers);
mutex_unlock(&tty_mutex);

if ( !(driver->flags & TTY_DRIVER_DYNAMIC_DEV) ) {
for(i = 0; i < driver->num; i++)
Expand All @@ -3796,8 +3798,9 @@ int tty_unregister_driver(struct tty_driver *driver)

unregister_chrdev_region(MKDEV(driver->major, driver->minor_start),
driver->num);

mutex_lock(&tty_mutex);
list_del(&driver->tty_drivers);
mutex_unlock(&tty_mutex);

/*
* Free the termios and termios_locked structures because
Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/proc/proc_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ static void *t_start(struct seq_file *m, loff_t *pos)
{
struct list_head *p;
loff_t l = *pos;

mutex_lock(&tty_mutex);
list_for_each(p, &tty_drivers)
if (!l--)
return list_entry(p, struct tty_driver, tty_drivers);
Expand All @@ -124,6 +126,7 @@ static void *t_next(struct seq_file *m, void *v, loff_t *pos)

static void t_stop(struct seq_file *m, void *v)
{
mutex_unlock(&tty_mutex);
}

static struct seq_operations tty_drivers_op = {
Expand Down

0 comments on commit aa83a53

Please sign in to comment.