Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 8421
b: refs/heads/master
c: 7b4ccf8
h: refs/heads/master
i:
  8419: bbf7637
v: v3
  • Loading branch information
Nishanth Aravamudan authored and Linus Torvalds committed Sep 10, 2005
1 parent 4b9079c commit 8c77daf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: da4cd8dfe18ee901b880f94ca0fa79d5cc1cd0eb
refs/heads/master: 7b4ccf8db4c1dc343ad5d6ed19240bbc3b5f945f
7 changes: 3 additions & 4 deletions trunk/drivers/parport/ieee1284.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ int parport_wait_peripheral(struct parport *port,
return 1;

/* 40ms of slow polling. */
deadline = jiffies + (HZ + 24) / 25;
deadline = jiffies + msecs_to_jiffies(40);
while (time_before (jiffies, deadline)) {
int ret;

Expand All @@ -205,7 +205,7 @@ int parport_wait_peripheral(struct parport *port,

/* Wait for 10ms (or until an interrupt occurs if
* the handler is set) */
if ((ret = parport_wait_event (port, (HZ + 99) / 100)) < 0)
if ((ret = parport_wait_event (port, msecs_to_jiffies(10))) < 0)
return ret;

status = parport_read_status (port);
Expand All @@ -216,8 +216,7 @@ int parport_wait_peripheral(struct parport *port,
/* parport_wait_event didn't time out, but the
* peripheral wasn't actually ready either.
* Wait for another 10ms. */
__set_current_state (TASK_INTERRUPTIBLE);
schedule_timeout ((HZ+ 99) / 100);
schedule_timeout_interruptible(msecs_to_jiffies(10));
}
}

Expand Down
10 changes: 4 additions & 6 deletions trunk/drivers/parport/ieee1284_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ size_t parport_ieee1284_write_compat (struct parport *port,
parport_data_forward (port);
while (count < len) {
unsigned long expire = jiffies + dev->timeout;
long wait = (HZ + 99) / 100;
long wait = msecs_to_jiffies(10);
unsigned char mask = (PARPORT_STATUS_ERROR
| PARPORT_STATUS_BUSY);
unsigned char val = (PARPORT_STATUS_ERROR
Expand Down Expand Up @@ -97,8 +97,7 @@ size_t parport_ieee1284_write_compat (struct parport *port,
our interrupt handler called. */
if (count && no_irq) {
parport_release (dev);
__set_current_state (TASK_INTERRUPTIBLE);
schedule_timeout (wait);
schedule_timeout_interruptible(wait);
parport_claim_or_block (dev);
}
else
Expand Down Expand Up @@ -542,13 +541,12 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port,
/* Yield the port for a while. */
if (count && dev->port->irq != PARPORT_IRQ_NONE) {
parport_release (dev);
__set_current_state (TASK_INTERRUPTIBLE);
schedule_timeout ((HZ + 24) / 25);
schedule_timeout_interruptible(msecs_to_jiffies(40));
parport_claim_or_block (dev);
}
else
/* We must have the device claimed here. */
parport_wait_event (port, (HZ + 24) / 25);
parport_wait_event (port, msecs_to_jiffies(40));

/* Is there a signal pending? */
if (signal_pending (current))
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/parport/parport_pc.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ static int change_mode(struct parport *p, int m)
if (time_after_eq (jiffies, expire))
/* The FIFO is stuck. */
return -EBUSY;
__set_current_state (TASK_INTERRUPTIBLE);
schedule_timeout ((HZ + 99) / 100);
schedule_timeout_interruptible(msecs_to_jiffies(10));
if (signal_pending (current))
break;
}
Expand Down

0 comments on commit 8c77daf

Please sign in to comment.