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 */
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)
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;
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++;
}
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;
}
#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);