]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/serial/ftdi_sio.c
Merge branch 'for-2.6.30' of git://git.kernel.dk/linux-2.6-block
[linux-2.6-omap-h63xx.git] / drivers / usb / serial / ftdi_sio.c
index ae84c326a54039cf7ef077823d94550860df74b5..dcc87aaa86282b186bdc1cdd024eb97a9cb9e27b 100644 (file)
@@ -1938,18 +1938,16 @@ static void ftdi_process_read(struct work_struct *work)
                /* Compare new line status to the old one, signal if different/
                   N.B. packet may be processed more than once, but differences
                   are only processed once.  */
-               if (priv != NULL) {
-                       char new_status = data[packet_offset + 0] &
-                                                       FTDI_STATUS_B0_MASK;
-                       if (new_status != priv->prev_status) {
-                               priv->diff_status |=
-                                       new_status ^ priv->prev_status;
-                               wake_up_interruptible(&priv->delta_msr_wait);
-                               priv->prev_status = new_status;
-                       }
+               char new_status = data[packet_offset + 0] &
+                                               FTDI_STATUS_B0_MASK;
+               if (new_status != priv->prev_status) {
+                       priv->diff_status |=
+                               new_status ^ priv->prev_status;
+                       wake_up_interruptible(&priv->delta_msr_wait);
+                       priv->prev_status = new_status;
                }
 
-               length = min(PKTSZ, urb->actual_length-packet_offset)-2;
+               length = min_t(u32, PKTSZ, urb->actual_length-packet_offset)-2;
                if (length < 0) {
                        dev_err(&port->dev, "%s - bad packet length: %d\n",
                                __func__, length+2);
@@ -2294,11 +2292,8 @@ static int ftdi_tiocmget(struct tty_struct *tty, struct file *file)
                           FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
                           0, 0,
                           buf, 1, WDR_TIMEOUT);
-               if (ret < 0) {
-                       dbg("%s Could not get modem status of device - err: %d", __func__,
-                           ret);
+               if (ret < 0)
                        return ret;
-               }
                break;
        case FT8U232AM:
        case FT232BM:
@@ -2313,15 +2308,11 @@ static int ftdi_tiocmget(struct tty_struct *tty, struct file *file)
                                   FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
                                   0, priv->interface,
                                   buf, 2, WDR_TIMEOUT);
-               if (ret < 0) {
-                       dbg("%s Could not get modem status of device - err: %d", __func__,
-                           ret);
+               if (ret < 0)
                        return ret;
-               }
                break;
        default:
                return -EFAULT;
-               break;
        }
 
        return  (buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) |