vserver 2.0 rc7
[linux-2.6.git] / drivers / net / irda / stir4200.c
index 648a713..66f488c 100644 (file)
@@ -208,7 +208,7 @@ static int write_reg(struct stir_cb *stir, __u16 reg, __u8 value)
                               REQ_WRITE_SINGLE,
                               USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_DEVICE,
                               value, reg, NULL, 0,
-                              msecs_to_jiffies(CTRL_TIMEOUT));
+                              CTRL_TIMEOUT);
 }
 
 /* Send control message to read multiple registers */
@@ -221,7 +221,7 @@ static inline int read_reg(struct stir_cb *stir, __u16 reg,
                               REQ_READ_REG,
                               USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
                               0, reg, data, count,
-                              msecs_to_jiffies(CTRL_TIMEOUT));
+                              CTRL_TIMEOUT);
 }
 
 static inline int isfir(u32 speed)
@@ -671,7 +671,8 @@ static void turnaround_delay(const struct stir_cb *stir, long us)
                return;
 
        do_gettimeofday(&now);
-       us -= (now.tv_sec - stir->rx_time.tv_sec) * USEC_PER_SEC;
+       if (now.tv_sec - stir->rx_time.tv_sec > 0)
+               us -= USEC_PER_SEC;
        us -= now.tv_usec - stir->rx_time.tv_usec;
        if (us < 10)
                return;
@@ -740,7 +741,7 @@ static void stir_send(struct stir_cb *stir, struct sk_buff *skb)
 
        if (usb_bulk_msg(stir->usbdev, usb_sndbulkpipe(stir->usbdev, 1),
                         stir->io_buf, wraplen,
-                        NULL, msecs_to_jiffies(TRANSMIT_TIMEOUT)))
+                        NULL, TRANSMIT_TIMEOUT))
                stir->stats.tx_errors++;
 }
 
@@ -787,7 +788,7 @@ static int stir_transmit_thread(void *arg)
                                stir_send(stir, skb);
                        dev_kfree_skb(skb);
 
-                       if (stir->speed != new_speed) {
+                       if ((new_speed != -1) && (stir->speed != new_speed)) {
                                if (fifo_txwait(stir, -1) ||
                                    change_speed(stir, new_speed))
                                        break;
@@ -1127,8 +1128,8 @@ static void stir_disconnect(struct usb_interface *intf)
 }
 
 #ifdef CONFIG_PM
-/* Power management suspend, so power off the transmitter/receiver */
-static int stir_suspend(struct usb_interface *intf, u32 state)
+/* USB suspend, so power off the transmitter/receiver */
+static int stir_suspend(struct usb_interface *intf, pm_message_t message)
 {
        struct stir_cb *stir = usb_get_intfdata(intf);