}
if (read_timeout) {
- timeout = jiffies + read_timeout * HZ / 1000;
+ timeout = jiffies + msecs_to_jiffies(read_timeout);
}
/* wait for data */
/* reset read timeout during read or write activity */
if (read_timeout
&& (dev->read_buffer_length || dev->interrupt_out_busy)) {
- timeout = jiffies + read_timeout * HZ / 1000;
+ timeout = jiffies + msecs_to_jiffies(read_timeout);
}
/* check for read timeout */
if (read_timeout && time_after (jiffies, timeout)) {
dev->read_buffer_length = 0;
dev->read_packet_length = 0;
spin_lock_init (&dev->read_buffer_lock);
- dev->packet_timeout_jiffies = packet_timeout * HZ / 1000;
+ dev->packet_timeout_jiffies = msecs_to_jiffies(packet_timeout);
dev->read_last_arrival = jiffies;
init_waitqueue_head (&dev->read_wait);