The following functions: pl2303_write_room(), pl2303_chars_in_buffer(), pl2303_ioctl(), wait_modem_info().
are not needed in the pl2303 Serial Core version, mostly because the Serial Core implements them for us. Signed-off-by: Luiz Fernando N. Capitulino <[EMAIL PROTECTED]> --- drivers/usb/serial/pl2303.c | 92 ------------------------------------------- 1 files changed, 0 insertions(+), 92 deletions(-) diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index f59892a..cf04ae0 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -130,8 +130,6 @@ #define UART_CTS 0x80 static void pl2303_set_mctrl(struct uart_port *port, unsigned int mctrl); static unsigned int pl2303_get_mctrl(struct uart_port *port); static void pl2303_start_tx(struct uart_port *port); -static int pl2303_ioctl (struct usb_serial_port *port, struct file *file, - unsigned int cmd, unsigned long arg); static void pl2303_break(struct uart_port *port, int break_state); static void pl2303_set_termios(struct uart_port *port, struct termios *termios, @@ -142,8 +140,6 @@ static void pl2303_read_int_callback (st static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs); static void pl2303_write_bulk_callback (struct urb *urb, struct pt_regs *regs); static void pl2303_send (struct usb_serial_port *port); -static int pl2303_write_room(struct usb_serial_port *port); -static int pl2303_chars_in_buffer(struct usb_serial_port *port); static int pl2303_attach(struct usb_serial *serial); static void pl2303_usb_shutdown(struct usb_serial *serial); static struct pl2303_buf *pl2303_buf_alloc(unsigned int size); @@ -178,12 +174,9 @@ static struct usb_serial_driver pl2303_d .num_bulk_out = 1, .num_ports = 1, .uart_ops = &pl2303_uart_ops, - .ioctl = pl2303_ioctl, .read_bulk_callback = pl2303_read_bulk_callback, .read_int_callback = pl2303_read_int_callback, .write_bulk_callback = pl2303_write_bulk_callback, - .write_room = pl2303_write_room, - .chars_in_buffer = pl2303_chars_in_buffer, .attach = pl2303_attach, .shutdown = pl2303_usb_shutdown, }; @@ -789,91 +782,6 @@ submit: uart_write_wakeup(port); } -static int pl2303_write_room(struct usb_serial_port *port) -{ - struct pl2303_private *priv = usb_get_serial_port_data(port); - int room = 0; - unsigned long flags; - - dbg("port %d", port->number); - - spin_lock_irqsave(&priv->lock, flags); - room = pl2303_buf_space_avail(priv->buf); - spin_unlock_irqrestore(&priv->lock, flags); - - dbg("returns %d", room); - return room; -} - -static int pl2303_chars_in_buffer(struct usb_serial_port *port) -{ - struct pl2303_private *priv = usb_get_serial_port_data(port); - int chars = 0; - unsigned long flags; - - dbg("port %d", port->number); - - spin_lock_irqsave(&priv->lock, flags); - chars = pl2303_buf_data_avail(priv->buf); - spin_unlock_irqrestore(&priv->lock, flags); - - dbg("returns %d", chars); - return chars; -} - -static int wait_modem_info(struct usb_serial_port *port, unsigned int arg) -{ - struct pl2303_private *priv = usb_get_serial_port_data(port); - unsigned long flags; - unsigned int prevstatus; - unsigned int status; - unsigned int changed; - - spin_lock_irqsave (&priv->lock, flags); - prevstatus = priv->line_status; - spin_unlock_irqrestore (&priv->lock, flags); - - while (1) { - interruptible_sleep_on(&priv->delta_msr_wait); - /* see if a signal did it */ - if (signal_pending(current)) - return -ERESTARTSYS; - - spin_lock_irqsave (&priv->lock, flags); - status = priv->line_status; - spin_unlock_irqrestore (&priv->lock, flags); - - changed=prevstatus^status; - - if (((arg & TIOCM_RNG) && (changed & UART_RING)) || - ((arg & TIOCM_DSR) && (changed & UART_DSR)) || - ((arg & TIOCM_CD) && (changed & UART_DCD)) || - ((arg & TIOCM_CTS) && (changed & UART_CTS)) ) { - return 0; - } - prevstatus = status; - } - /* NOTREACHED */ - return 0; -} - -static int pl2303_ioctl (struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg) -{ - dbg("(%d) cmd = 0x%04x", port->number, cmd); - - switch (cmd) { - case TIOCMIWAIT: - dbg("(%d) TIOCMIWAIT", port->number); - return wait_modem_info(port, arg); - - default: - dbg("not supported = 0x%04x", cmd); - break; - } - - return -ENOIOCTLCMD; -} - static void pl2303_usb_shutdown(struct usb_serial *serial) { int i; -- 1.3.3.g0825d _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel