Request initial configuration on tty open.
authorFlorian Pose <fp@igh-essen.com>
Fri, 22 Jan 2010 11:02:04 +0100
changeset 1781 e3346de75612
parent 1780 11f452ca4d7a
child 1782 2ba454c790c5
Request initial configuration on tty open.
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;
 }