Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248654
b: refs/heads/master
c: 6716671
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Apr 19, 2011
1 parent 4d1567c commit 1b54817
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c18d77aa00cde1215d9e045ba8f93004fe843f38
refs/heads/master: 6716671d8c1c07a8072098764d1b7cbfef7412ad
14 changes: 14 additions & 0 deletions trunk/drivers/tty/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2886,6 +2886,20 @@ void initialize_tty_struct(struct tty_struct *tty,
tty->dev = tty_get_device(tty);
}

/**
* deinitialize_tty_struct
* @tty: tty to deinitialize
*
* This subroutine deinitializes a tty structure that has been newly
* allocated but tty_release cannot be called on that yet.
*
* Locking: none - tty in question must not be exposed at this point
*/
void deinitialize_tty_struct(struct tty_struct *tty)
{
tty_ldisc_deinit(tty);
}

/**
* tty_put_char - write one character to a tty
* @tty: tty
Expand Down
13 changes: 13 additions & 0 deletions trunk/drivers/tty/tty_ldisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,19 @@ void tty_ldisc_init(struct tty_struct *tty)
tty_ldisc_assign(tty, ld);
}

/**
* tty_ldisc_init - ldisc cleanup for new tty
* @tty: tty that was allocated recently
*
* The tty structure must not becompletely set up (tty_ldisc_setup) when
* this call is made.
*/
void tty_ldisc_deinit(struct tty_struct *tty)
{
put_ldisc(tty->ldisc);
tty_ldisc_assign(tty, NULL);
}

void tty_ldisc_begin(void)
{
/* Setup the default TTY line discipline. */
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/tty.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ extern int tty_add_file(struct tty_struct *tty, struct file *file);
extern void free_tty_struct(struct tty_struct *tty);
extern void initialize_tty_struct(struct tty_struct *tty,
struct tty_driver *driver, int idx);
extern void deinitialize_tty_struct(struct tty_struct *tty);
extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx,
int first_ok);
extern int tty_release(struct inode *inode, struct file *filp);
Expand Down Expand Up @@ -525,6 +526,7 @@ extern int tty_set_ldisc(struct tty_struct *tty, int ldisc);
extern int tty_ldisc_setup(struct tty_struct *tty, struct tty_struct *o_tty);
extern void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty);
extern void tty_ldisc_init(struct tty_struct *tty);
extern void tty_ldisc_deinit(struct tty_struct *tty);
extern void tty_ldisc_begin(void);
/* This last one is just for the tty layer internals and shouldn't be used elsewhere */
extern void tty_ldisc_enable(struct tty_struct *tty);
Expand Down

0 comments on commit 1b54817

Please sign in to comment.