]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/serial/whiteheat.c
USB: remove info() macro from usb/serial drivers
[linux-2.6-omap-h63xx.git] / drivers / usb / serial / whiteheat.c
index 2569b68b8334066926c3d26e1caee540d95dbbb4..39f7f8d291d6ec8669d9a0ca0c65a22f4fbc9073 100644 (file)
@@ -452,8 +452,9 @@ static int whiteheat_attach(struct usb_serial *serial)
 
        hw_info = (struct whiteheat_hw_info *)&result[1];
 
-       info("%s: Driver %s: Firmware v%d.%02d", serial->type->description,
-            DRIVER_VERSION, hw_info->sw_major_rev, hw_info->sw_minor_rev);
+       dev_info(&serial->dev->dev, "%s: Driver %s: Firmware v%d.%02d\n",
+                serial->type->description, DRIVER_VERSION,
+                hw_info->sw_major_rev, hw_info->sw_minor_rev);
 
        for (i = 0; i < serial->num_ports; i++) {
                port = serial->port[i];
@@ -646,7 +647,6 @@ static int whiteheat_open(struct tty_struct *tty,
                        struct usb_serial_port *port, struct file *filp)
 {
        int             retval = 0;
-       struct ktermios old_term;
 
        dbg("%s - port %d", __func__, port->number);
 
@@ -671,11 +671,8 @@ static int whiteheat_open(struct tty_struct *tty,
                goto exit;
        }
 
-       if (tty) {
-               old_term.c_cflag = ~tty->termios->c_cflag;
-               old_term.c_iflag = ~tty->termios->c_iflag;
-               whiteheat_set_termios(tty, port, &old_term);
-       }
+       if (tty)
+               firm_setup_port(tty);
 
        /* Work around HCD bugs */
        usb_clear_halt(port->serial->dev, port->read_urb->pipe);
@@ -926,7 +923,6 @@ static int whiteheat_ioctl(struct tty_struct *tty, struct file *file,
 static void whiteheat_set_termios(struct tty_struct *tty,
        struct usb_serial_port *port, struct ktermios *old_termios)
 {
-       /* FIXME */
        firm_setup_port(tty);
 }
 
@@ -1322,7 +1318,7 @@ static int firm_set_dtr(struct usb_serial_port *port, __u8 onoff)
 
        dtr_command.port = port->number - port->serial->minor + 1;
        dtr_command.state = onoff;
-       return firm_send_command(port, WHITEHEAT_SET_RTS,
+       return firm_send_command(port, WHITEHEAT_SET_DTR,
                        (__u8 *)&dtr_command, sizeof(dtr_command));
 }
 
@@ -1333,7 +1329,7 @@ static int firm_set_break(struct usb_serial_port *port, __u8 onoff)
 
        break_command.port = port->number - port->serial->minor + 1;
        break_command.state = onoff;
-       return firm_send_command(port, WHITEHEAT_SET_RTS,
+       return firm_send_command(port, WHITEHEAT_SET_BREAK,
                        (__u8 *)&break_command, sizeof(break_command));
 }
 
@@ -1486,7 +1482,7 @@ static void rx_data_softint(struct work_struct *work)
        struct whiteheat_private *info =
                container_of(work, struct whiteheat_private, rx_work);
        struct usb_serial_port *port = info->port;
-       struct tty_struct *tty = port->port.tty;
+       struct tty_struct *tty = tty_port_tty_get(&port->port);
        struct whiteheat_urb_wrap *wrap;
        struct urb *urb;
        unsigned long flags;
@@ -1498,7 +1494,7 @@ static void rx_data_softint(struct work_struct *work)
        spin_lock_irqsave(&info->lock, flags);
        if (info->flags & THROTTLED) {
                spin_unlock_irqrestore(&info->lock, flags);
-               return;
+               goto out;
        }
 
        list_for_each_safe(tmp, tmp2, &info->rx_urb_q) {
@@ -1518,7 +1514,7 @@ static void rx_data_softint(struct work_struct *work)
                                spin_unlock_irqrestore(&info->lock, flags);
                                tty_flip_buffer_push(tty);
                                schedule_work(&info->rx_work);
-                               return;
+                               goto out;
                        }
                        tty_insert_flip_string(tty, urb->transfer_buffer, len);
                        sent += len;
@@ -1541,6 +1537,8 @@ static void rx_data_softint(struct work_struct *work)
 
        if (sent)
                tty_flip_buffer_push(tty);
+out:
+       tty_kref_put(tty);
 }
 
 
@@ -1559,7 +1557,8 @@ static int __init whiteheat_init(void)
        retval = usb_register(&whiteheat_driver);
        if (retval)
                goto failed_usb_register;
-       info(DRIVER_DESC " " DRIVER_VERSION);
+       printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
+              DRIVER_DESC "\n");
        return 0;
 failed_usb_register:
        usb_serial_deregister(&whiteheat_device);