diff options
author | Alan Cox <alan@linux.intel.com> | 2009-06-11 07:51:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-11 11:51:01 -0400 |
commit | 852e99d22f2231d232c45216b027565e3bae7add (patch) | |
tree | 72994a459e66e8d8be15b304ded74c2654cc3a44 /drivers/char | |
parent | f2c4c65c8350d885d74dcdea7061dcecc1223c36 (diff) |
tty: bring ldisc into CodingStyle
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/tty_ldisc.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/char/tty_ldisc.c b/drivers/char/tty_ldisc.c index 01c70c01f64a..39c8f86dedd4 100644 --- a/drivers/char/tty_ldisc.c +++ b/drivers/char/tty_ldisc.c | |||
@@ -126,7 +126,7 @@ static struct tty_ldisc *tty_ldisc_try_get(int disc) | |||
126 | struct tty_ldisc *ld; | 126 | struct tty_ldisc *ld; |
127 | struct tty_ldisc_ops *ldops; | 127 | struct tty_ldisc_ops *ldops; |
128 | int err = -EINVAL; | 128 | int err = -EINVAL; |
129 | 129 | ||
130 | ld = kmalloc(sizeof(struct tty_ldisc), GFP_KERNEL); | 130 | ld = kmalloc(sizeof(struct tty_ldisc), GFP_KERNEL); |
131 | if (ld == NULL) | 131 | if (ld == NULL) |
132 | return ERR_PTR(-ENOMEM); | 132 | return ERR_PTR(-ENOMEM); |
@@ -208,12 +208,12 @@ static void tty_ldisc_put(struct tty_ldisc *ld) | |||
208 | kfree(ld); | 208 | kfree(ld); |
209 | } | 209 | } |
210 | 210 | ||
211 | static void * tty_ldiscs_seq_start(struct seq_file *m, loff_t *pos) | 211 | static void *tty_ldiscs_seq_start(struct seq_file *m, loff_t *pos) |
212 | { | 212 | { |
213 | return (*pos < NR_LDISCS) ? pos : NULL; | 213 | return (*pos < NR_LDISCS) ? pos : NULL; |
214 | } | 214 | } |
215 | 215 | ||
216 | static void * tty_ldiscs_seq_next(struct seq_file *m, void *v, loff_t *pos) | 216 | static void *tty_ldiscs_seq_next(struct seq_file *m, void *v, loff_t *pos) |
217 | { | 217 | { |
218 | (*pos)++; | 218 | (*pos)++; |
219 | return (*pos < NR_LDISCS) ? pos : NULL; | 219 | return (*pos < NR_LDISCS) ? pos : NULL; |
@@ -227,7 +227,7 @@ static int tty_ldiscs_seq_show(struct seq_file *m, void *v) | |||
227 | { | 227 | { |
228 | int i = *(loff_t *)v; | 228 | int i = *(loff_t *)v; |
229 | struct tty_ldisc *ld; | 229 | struct tty_ldisc *ld; |
230 | 230 | ||
231 | ld = tty_ldisc_try_get(i); | 231 | ld = tty_ldisc_try_get(i); |
232 | if (IS_ERR(ld)) | 232 | if (IS_ERR(ld)) |
233 | return 0; | 233 | return 0; |
@@ -325,7 +325,6 @@ struct tty_ldisc *tty_ldisc_ref_wait(struct tty_struct *tty) | |||
325 | WARN_ON(tty->ldisc->refcount == 0); | 325 | WARN_ON(tty->ldisc->refcount == 0); |
326 | return tty->ldisc; | 326 | return tty->ldisc; |
327 | } | 327 | } |
328 | |||
329 | EXPORT_SYMBOL_GPL(tty_ldisc_ref_wait); | 328 | EXPORT_SYMBOL_GPL(tty_ldisc_ref_wait); |
330 | 329 | ||
331 | /** | 330 | /** |
@@ -345,7 +344,6 @@ struct tty_ldisc *tty_ldisc_ref(struct tty_struct *tty) | |||
345 | return tty->ldisc; | 344 | return tty->ldisc; |
346 | return NULL; | 345 | return NULL; |
347 | } | 346 | } |
348 | |||
349 | EXPORT_SYMBOL_GPL(tty_ldisc_ref); | 347 | EXPORT_SYMBOL_GPL(tty_ldisc_ref); |
350 | 348 | ||
351 | /** | 349 | /** |
@@ -373,7 +371,6 @@ void tty_ldisc_deref(struct tty_ldisc *ld) | |||
373 | wake_up(&tty_ldisc_wait); | 371 | wake_up(&tty_ldisc_wait); |
374 | spin_unlock_irqrestore(&tty_ldisc_lock, flags); | 372 | spin_unlock_irqrestore(&tty_ldisc_lock, flags); |
375 | } | 373 | } |
376 | |||
377 | EXPORT_SYMBOL_GPL(tty_ldisc_deref); | 374 | EXPORT_SYMBOL_GPL(tty_ldisc_deref); |
378 | 375 | ||
379 | /** | 376 | /** |
@@ -413,7 +410,6 @@ void tty_ldisc_flush(struct tty_struct *tty) | |||
413 | } | 410 | } |
414 | tty_buffer_flush(tty); | 411 | tty_buffer_flush(tty); |
415 | } | 412 | } |
416 | |||
417 | EXPORT_SYMBOL_GPL(tty_ldisc_flush); | 413 | EXPORT_SYMBOL_GPL(tty_ldisc_flush); |
418 | 414 | ||
419 | /** | 415 | /** |
@@ -492,7 +488,7 @@ static void tty_ldisc_restore(struct tty_struct *tty, struct tty_ldisc *old) | |||
492 | if (tty_ldisc_open(tty, old) < 0) { | 488 | if (tty_ldisc_open(tty, old) < 0) { |
493 | tty_ldisc_put(old); | 489 | tty_ldisc_put(old); |
494 | /* This driver is always present */ | 490 | /* This driver is always present */ |
495 | new_ldisc =tty_ldisc_get(N_TTY); | 491 | new_ldisc = tty_ldisc_get(N_TTY); |
496 | if (IS_ERR(new_ldisc)) | 492 | if (IS_ERR(new_ldisc)) |
497 | panic("n_tty: get"); | 493 | panic("n_tty: get"); |
498 | tty_ldisc_assign(tty, new_ldisc); | 494 | tty_ldisc_assign(tty, new_ldisc); |
@@ -514,7 +510,7 @@ static void tty_ldisc_restore(struct tty_struct *tty, struct tty_ldisc *old) | |||
514 | * be obtained while the delayed work queue halt ensures that no more | 510 | * be obtained while the delayed work queue halt ensures that no more |
515 | * data is fed to the ldisc. | 511 | * data is fed to the ldisc. |
516 | * | 512 | * |
517 | * In order to wait for any existing references to complete see | 513 | * In order to wait for any existing references to complete see |
518 | * tty_ldisc_wait_idle. | 514 | * tty_ldisc_wait_idle. |
519 | */ | 515 | */ |
520 | 516 | ||
@@ -611,7 +607,7 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc) | |||
611 | mutex_lock(&tty->ldisc_mutex); | 607 | mutex_lock(&tty->ldisc_mutex); |
612 | } | 608 | } |
613 | set_bit(TTY_LDISC_CHANGING, &tty->flags); | 609 | set_bit(TTY_LDISC_CHANGING, &tty->flags); |
614 | 610 | ||
615 | /* | 611 | /* |
616 | * No more input please, we are switching. The new ldisc | 612 | * No more input please, we are switching. The new ldisc |
617 | * will update this value in the ldisc open function | 613 | * will update this value in the ldisc open function |
@@ -841,8 +837,8 @@ int tty_ldisc_setup(struct tty_struct *tty, struct tty_struct *o_tty) | |||
841 | * @tty: tty being shut down | 837 | * @tty: tty being shut down |
842 | * @o_tty: pair tty for pty/tty pairs | 838 | * @o_tty: pair tty for pty/tty pairs |
843 | * | 839 | * |
844 | * Called during the final close of a tty/pty pair in order to shut down the | 840 | * Called during the final close of a tty/pty pair in order to shut down |
845 | * line discpline layer. On exit the ldisc assigned is N_TTY and the | 841 | * the line discpline layer. On exit the ldisc assigned is N_TTY and the |
846 | * ldisc has not been opened. | 842 | * ldisc has not been opened. |
847 | */ | 843 | */ |
848 | 844 | ||