# HG changeset patch
# User Florian Pose <fp@igh-essen.com>
# Date 1264154524 -3600
# Node ID e3346de75612930e79eba98cf81e9988ab1e7e19
# Parent  11f452ca4d7ad41198a667713abe825bdc8415bc
Request initial configuration on tty open.

diff -r 11f452ca4d7a -r e3346de75612 tty/module.c
--- a/tty/module.c	Fri Jan 22 10:36:36 2010 +0100
+++ b/tty/module.c	Fri Jan 22 11:02:04 2010 +0100
@@ -336,7 +336,7 @@
 static int ec_tty_open(struct tty_struct *tty, struct file *file)
 {
     ec_tty_t *t;
-    int line = tty->index;
+    int line = tty->index, ret;
 
 #if EC_TTY_DEBUG >= 1
     printk(KERN_INFO PFX "Opening line %i.\n", line);
@@ -357,6 +357,15 @@
 
     t->tty = tty;
     tty->driver_data = t;
+
+    // request initial settings
+    ret = t->cflag_cb(t->cb_data, t->tty->termios->c_cflag);
+    if (ret) {
+        printk(KERN_ERR PFX "Error: Device does not accept"
+                " initial configuration!\n");
+        return ret;
+    }
+
     return 0;
 }