1 From d61f08750bea76b4480102fe300a6f8c4992126c Mon Sep 17 00:00:00 2001
2 From: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
3 Date: Sun, 28 May 2006 22:33:24 -0300
4 Subject: [PATCH 6/11] usbserial: Removes obsolated data.
6 usbserial's mutex, open_count and tty_struct pointer in
7 struct usb_serial_port have been obsolated by the Serial Core port.
9 Note that was necessary to change some bits in the generic code to
12 Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
14 drivers/usb/serial/generic.c | 6 +++---
15 drivers/usb/serial/usb-serial.c | 6 ------
16 drivers/usb/serial/usb-serial.h | 9 ---------
17 3 files changed, 3 insertions(+), 18 deletions(-)
19 diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
20 index c62cc28..9ae4764 100644
21 --- a/drivers/usb/serial/generic.c
22 +++ b/drivers/usb/serial/generic.c
23 @@ -117,8 +117,8 @@ int usb_serial_generic_open (struct usb_
24 /* force low_latency on so that our tty_push actually forces the data through,
25 otherwise it is scheduled, and with high data rates (like with OHCI) data
28 - port->tty->low_latency = 1;
29 + if (port->uart_port.info->tty)
30 + port->uart_port.info->tty->low_latency = 1;
32 /* if we have a bulk interrupt, start reading from it */
33 if (serial->num_bulk_in) {
34 @@ -266,7 +266,7 @@ void usb_serial_generic_read_bulk_callba
36 usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
39 + tty = port->uart_port.info->tty;
40 if (tty && urb->actual_length) {
41 tty_buffer_request_room(tty, urb->actual_length);
42 tty_insert_flip_string(tty, data, urb->actual_length);
43 diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
44 index f4db7a9..fcfc4dc 100644
45 --- a/drivers/usb/serial/usb-serial.c
46 +++ b/drivers/usb/serial/usb-serial.c
47 @@ -28,7 +28,6 @@ #include <linux/serial_core.h>
48 #include <linux/module.h>
49 #include <linux/moduleparam.h>
50 #include <linux/spinlock.h>
51 -#include <linux/mutex.h>
52 #include <linux/list.h>
53 #include <linux/smp_lock.h>
54 #include <asm/uaccess.h>
55 @@ -118,9 +117,6 @@ static void destroy_serial(struct usb_se
56 /* return the minor range that this device had */
57 return_serial(serial);
59 - for (i = 0; i < serial->num_ports; ++i)
60 - serial->port[i]->open_count = 0;
62 /* the ports are cleaned up and released in port_release() */
63 for (i = 0; i < serial->num_ports; ++i)
64 if (serial->port[i]->dev.parent != NULL) {
65 @@ -390,7 +386,6 @@ static struct usb_serial * create_serial
66 serial->dev = usb_get_dev(dev);
67 serial->type = driver;
68 serial->interface = interface;
69 - kref_init(&serial->kref);
73 @@ -627,7 +622,6 @@ #endif
74 port->number = i + serial->minor;
75 port->serial = serial;
76 spin_lock_init(&port->lock);
77 - mutex_init(&port->mutex);
78 INIT_WORK(&port->work, usb_serial_port_softint, port);
79 serial->port[i] = port;
81 diff --git a/drivers/usb/serial/usb-serial.h b/drivers/usb/serial/usb-serial.h
82 index b273efa..bc7d5e0 100644
83 --- a/drivers/usb/serial/usb-serial.h
84 +++ b/drivers/usb/serial/usb-serial.h
85 @@ -15,8 +15,6 @@ #ifndef __LINUX_USB_SERIAL_H
86 #define __LINUX_USB_SERIAL_H
88 #include <linux/config.h>
89 -#include <linux/kref.h>
90 -#include <linux/mutex.h>
91 #include <linux/serial_core.h>
93 #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */
94 @@ -35,8 +33,6 @@ #define RELEVANT_IFLAG(iflag) (iflag & (
95 * @serial: pointer back to the struct usb_serial owner of this port.
96 * @tty: pointer to the corresponding tty for this port.
97 * @lock: spinlock to grab when updating portions of this structure.
98 - * @mutex: mutex used to synchronize serial_open() and serial_close()
99 - * access for this port.
100 * @number: the number of the port (the minor number).
101 * @interrupt_in_buffer: pointer to the interrupt in buffer for this port.
102 * @interrupt_in_urb: pointer to the interrupt in struct urb for this port.
103 @@ -58,7 +54,6 @@ #define RELEVANT_IFLAG(iflag) (iflag & (
105 * @write_wait: a wait_queue_head_t used by the port.
106 * @work: work queue entry for the line discipline waking up.
107 - * @open_count: number of times this port has been opened.
109 * This structure is used by the usb-serial core and drivers for the specific
111 @@ -66,9 +61,7 @@ #define RELEVANT_IFLAG(iflag) (iflag & (
112 struct usb_serial_port {
113 struct uart_port uart_port;
114 struct usb_serial * serial;
115 - struct tty_struct * tty;
117 - struct mutex mutex;
118 unsigned char number;
120 unsigned char * interrupt_in_buffer;
121 @@ -93,7 +86,6 @@ struct usb_serial_port {
123 wait_queue_head_t write_wait;
124 struct work_struct work;
128 #define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev)
129 @@ -138,7 +130,6 @@ struct usb_serial {
132 struct usb_serial_port * port[MAX_NUM_PORTS];
136 #define to_usb_serial(d) container_of(d, struct usb_serial, kref)