aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-04-02 07:54:15 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-09 14:28:17 -0400
commit9d2ae2335ce69249403061da4f0da63d9b0763f6 (patch)
treef3f260fef9bef0601d4ec48ca02c9183b6caf5af /drivers/s390
parentb538c4eaf29176da55804963fb6a77883be6400a (diff)
TTY: tty3270, move initialization to allocation
Let us initialize all the tty3270's members at the place where the structure is allocated. It cleans up tty->ops->open a bit. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: linux390@de.ibm.com Cc: linux-s390@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/char/tty3270.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c
index b43445a55cb6..f3837da7ceab 100644
--- a/drivers/s390/char/tty3270.c
+++ b/drivers/s390/char/tty3270.c
@@ -690,6 +690,16 @@ tty3270_alloc_view(void)
690 if (!tp->freemem_pages) 690 if (!tp->freemem_pages)
691 goto out_tp; 691 goto out_tp;
692 INIT_LIST_HEAD(&tp->freemem); 692 INIT_LIST_HEAD(&tp->freemem);
693 INIT_LIST_HEAD(&tp->lines);
694 INIT_LIST_HEAD(&tp->update);
695 INIT_LIST_HEAD(&tp->rcl_lines);
696 tp->rcl_max = 20;
697 setup_timer(&tp->timer, (void (*)(unsigned long)) tty3270_update,
698 (unsigned long) tp);
699 tasklet_init(&tp->readlet,
700 (void (*)(unsigned long)) tty3270_read_tasklet,
701 (unsigned long) tp->read);
702
693 for (pages = 0; pages < TTY3270_STRING_PAGES; pages++) { 703 for (pages = 0; pages < TTY3270_STRING_PAGES; pages++) {
694 tp->freemem_pages[pages] = (void *) 704 tp->freemem_pages[pages] = (void *)
695 __get_free_pages(GFP_KERNEL|GFP_DMA, 0); 705 __get_free_pages(GFP_KERNEL|GFP_DMA, 0);
@@ -879,16 +889,6 @@ tty3270_open(struct tty_struct *tty, struct file * filp)
879 if (IS_ERR(tp)) 889 if (IS_ERR(tp))
880 return PTR_ERR(tp); 890 return PTR_ERR(tp);
881 891
882 INIT_LIST_HEAD(&tp->lines);
883 INIT_LIST_HEAD(&tp->update);
884 INIT_LIST_HEAD(&tp->rcl_lines);
885 tp->rcl_max = 20;
886 setup_timer(&tp->timer, (void (*)(unsigned long)) tty3270_update,
887 (unsigned long) tp);
888 tasklet_init(&tp->readlet,
889 (void (*)(unsigned long)) tty3270_read_tasklet,
890 (unsigned long) tp->read);
891
892 rc = raw3270_add_view(&tp->view, &tty3270_fn, 892 rc = raw3270_add_view(&tp->view, &tty3270_fn,
893 tty->index + RAW3270_FIRSTMINOR); 893 tty->index + RAW3270_FIRSTMINOR);
894 if (rc) { 894 if (rc) {