···34243424 goto check_and_exit;34253425 }3426342634273427- if (info->count > 1)34273427+ if (info->port.count > 1)34283428 return -EBUSY;3429342934303430 /*···37603760 printk("[%d] rs_close ttyS%d, count = %d\n", current->pid,37613761 info->line, info->count);37623762#endif37633763- if ((tty->count == 1) && (info->count != 1)) {37633763+ if ((tty->count == 1) && (info->port.count != 1)) {37643764 /*37653765 * Uh, oh. tty->count is 1, which means that the tty37663766 * structure will be freed. Info->count should always···37703770 */37713771 printk(KERN_ERR37723772 "rs_close: bad serial port count; tty->count is 1, "37733773- "info->count is %d\n", info->count);37743774- info->count = 1;37733773+ "info->count is %d\n", info->port.count);37743774+ info->port.count = 1;37753775 }37763776- if (--info->count < 0) {37763776+ if (--info->port.count < 0) {37773777 printk(KERN_ERR "rs_close: bad serial port count for ttyS%d: %d\n",37783778- info->line, info->count);37793779- info->count = 0;37783778+ info->line, info->port.count);37793779+ info->port.count = 0;37803780 }37813781- if (info->count) {37813781+ if (info->port.count) {37823782 local_irq_restore(flags);37833783 return;37843784 }···38243824 tty->closing = 0;38253825 info->event = 0;38263826 info->port.tty = NULL;38273827- if (info->blocked_open) {38273827+ if (info->port.blocked_open) {38283828 if (info->port.close_delay)38293829 schedule_timeout_interruptible(info->port.close_delay);38303830 wake_up_interruptible(&info->port.open_wait);···39233923 rs_flush_buffer(tty);39243924 shutdown(info);39253925 info->event = 0;39263926- info->count = 0;39263926+ info->port.count = 0;39273927 info->port.flags &= ~ASYNC_NORMAL_ACTIVE;39283928 info->port.tty = NULL;39293929 wake_up_interruptible(&info->port.open_wait);···39783978 /*39793979 * Block waiting for the carrier detect and the line to become39803980 * free (i.e., not in use by the callout). While we are in39813981- * this loop, info->count is dropped by one, so that39813981+ * this loop, info->port.count is dropped by one, so that39823982 * rs_close() knows when to free things. We restore it upon39833983 * exit, either normal or abnormal.39843984 */···39863986 add_wait_queue(&info->port.open_wait, &wait);39873987#ifdef SERIAL_DEBUG_OPEN39883988 printk("block_til_ready before block: ttyS%d, count = %d\n",39893989- info->line, info->count);39893989+ info->line, info->port.count);39903990#endif39913991 local_irq_save(flags);39923992 if (!tty_hung_up_p(filp)) {39933993 extra_count++;39943994- info->count--;39943994+ info->port.count--;39953995 }39963996 local_irq_restore(flags);39973997- info->blocked_open++;39973997+ info->port.blocked_open++;39983998 while (1) {39993999 local_irq_save(flags);40004000 /* assert RTS and DTR */···40234023 }40244024#ifdef SERIAL_DEBUG_OPEN40254025 printk("block_til_ready blocking: ttyS%d, count = %d\n",40264026- info->line, info->count);40264026+ info->line, info->port.count);40274027#endif40284028 tty_unlock(tty);40294029 schedule();···40324032 set_current_state(TASK_RUNNING);40334033 remove_wait_queue(&info->port.open_wait, &wait);40344034 if (extra_count)40354035- info->count++;40364036- info->blocked_open--;40354035+ info->port.count++;40364036+ info->port.blocked_open--;40374037#ifdef SERIAL_DEBUG_OPEN40384038 printk("block_til_ready after blocking: ttyS%d, count = %d\n",40394039- info->line, info->count);40394039+ info->line, info->port.count);40404040#endif40414041 if (retval)40424042 return retval;···4074407440754075#ifdef SERIAL_DEBUG_OPEN40764076 printk("[%d] rs_open %s, count = %d\n", current->pid, tty->name,40774077- info->count);40774077+ info->port.count);40784078#endif4079407940804080- info->count++;40804080+ info->port.count++;40814081 tty->driver_data = info;40824082 info->port.tty = tty;40834083···41014101 /*41024102 * If DMA is enabled try to allocate the irq's.41034103 */41044104- if (info->count == 1) {41044104+ if (info->port.count == 1) {41054105 allocated_resources = 1;41064106 if (info->dma_in_enabled) {41074107 if (request_irq(info->dma_in_irq_nbr,···41744174 if (allocated_resources)41754175 deinit_port(info);4176417641774177- /* FIXME Decrease count info->count here too? */41774177+ /* FIXME Decrease count info->port.count here too? */41784178 return retval;41794179 }41804180···41914191 return retval;41924192 }4193419341944194- if ((info->count == 1) && (info->port.flags & ASYNC_SPLIT_TERMIOS)) {41944194+ if ((info->port.count == 1) && (info->port.flags & ASYNC_SPLIT_TERMIOS)) {41954195 tty->termios = info->normal_termios;41964196 change_speed(info);41974197 }···44424442 info->custom_divisor = 0;44434443 info->x_char = 0;44444444 info->event = 0;44454445- info->count = 0;44464446- info->blocked_open = 0;44474445 info->normal_termios = driver->init_termios;44484446 info->xmit.buf = NULL;44494447 info->xmit.tail = info->xmit.head = 0;
-2
drivers/tty/serial/crisv10.h
···9090 unsigned long event;9191 int line;9292 int type; /* PORT_ETRAX */9393- int count; /* # of fd on device */9494- int blocked_open; /* # of blocked opens */9593 struct circ_buf xmit;9694 struct etrax_recv_buffer *first_recv_buffer;9795 struct etrax_recv_buffer *last_recv_buffer;