tty/module.c
changeset 1571 88167b8589ef
parent 1570 7a2a58107dd8
child 1572 b306e6976682
equal deleted inserted replaced
1570:7a2a58107dd8 1571:88167b8589ef
   185  * Device callbacks
   185  * Device callbacks
   186  *****************************************************************************/
   186  *****************************************************************************/
   187 
   187 
   188 static int ec_tty_open(struct tty_struct *tty, struct file *file)
   188 static int ec_tty_open(struct tty_struct *tty, struct file *file)
   189 {
   189 {
   190     return -EBUSY;
   190     ec_tty_t *t;
       
   191     int line = tty->index;
       
   192 
       
   193     printk(KERN_INFO PFX "Opening line %i.\n", line);
       
   194 
       
   195 	if (line < 0 || line >= EC_TTY_MAX_DEVICES) {
       
   196 		return -ENXIO;
       
   197     }
       
   198 
       
   199     t = ttys[line];
       
   200     if (!t) {
       
   201         return -ENXIO;
       
   202     }
       
   203 
       
   204     tty->driver_data = t;
       
   205     return 0;
   191 }
   206 }
   192 
   207 
   193 /*****************************************************************************/
   208 /*****************************************************************************/
   194 
   209 
   195 static void ec_tty_close(struct tty_struct *tty, struct file *file)
   210 static void ec_tty_close(struct tty_struct *tty, struct file *file)
   196 {
   211 {
   197     return;
   212     printk(KERN_INFO PFX "Closing line %i.\n", tty->index);
   198 }
   213 }
   199 
   214 
   200 /*****************************************************************************/
   215 /*****************************************************************************/
   201 
   216 
   202 static int ec_tty_write(
   217 static int ec_tty_write(