tty/module.c
changeset 1781 e3346de75612
parent 1779 9fab229d6ca9
child 1782 2ba454c790c5
equal deleted inserted replaced
1780:11f452ca4d7a 1781:e3346de75612
   334  *****************************************************************************/
   334  *****************************************************************************/
   335 
   335 
   336 static int ec_tty_open(struct tty_struct *tty, struct file *file)
   336 static int ec_tty_open(struct tty_struct *tty, struct file *file)
   337 {
   337 {
   338     ec_tty_t *t;
   338     ec_tty_t *t;
   339     int line = tty->index;
   339     int line = tty->index, ret;
   340 
   340 
   341 #if EC_TTY_DEBUG >= 1
   341 #if EC_TTY_DEBUG >= 1
   342     printk(KERN_INFO PFX "Opening line %i.\n", line);
   342     printk(KERN_INFO PFX "Opening line %i.\n", line);
   343 #endif
   343 #endif
   344 
   344 
   355         return -EBUSY;
   355         return -EBUSY;
   356     }
   356     }
   357 
   357 
   358     t->tty = tty;
   358     t->tty = tty;
   359     tty->driver_data = t;
   359     tty->driver_data = t;
       
   360 
       
   361     // request initial settings
       
   362     ret = t->cflag_cb(t->cb_data, t->tty->termios->c_cflag);
       
   363     if (ret) {
       
   364         printk(KERN_ERR PFX "Error: Device does not accept"
       
   365                 " initial configuration!\n");
       
   366         return ret;
       
   367     }
       
   368 
   360     return 0;
   369     return 0;
   361 }
   370 }
   362 
   371 
   363 /*****************************************************************************/
   372 /*****************************************************************************/
   364 
   373