aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/amr
diff options
context:
space:
mode:
authorPaul Saab <ps@FreeBSD.org>2005-07-29 01:47:36 +0000
committerPaul Saab <ps@FreeBSD.org>2005-07-29 01:47:36 +0000
commit8c61487b21a22b5bb9422b89eefa605ff7bff6dc (patch)
treefc7d7ec7f51f0c85574496e1c8637a19134f2dfa /sys/dev/amr
parentfa6e2680c0bf36148de5da4d5d1eae5888541c55 (diff)
Notes
Diffstat (limited to 'sys/dev/amr')
-rw-r--r--sys/dev/amr/amr.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/amr/amr.c b/sys/dev/amr/amr.c
index 6c51839533bb..a3bd999a9471 100644
--- a/sys/dev/amr/amr.c
+++ b/sys/dev/amr/amr.c
@@ -962,7 +962,7 @@ amr_bio_command(struct amr_softc *sc, struct amr_command **acp)
static int
amr_wait_command(struct amr_command *ac)
{
- int error, count;
+ int error = 0;
debug_called(1);
@@ -971,12 +971,10 @@ amr_wait_command(struct amr_command *ac)
if ((error = amr_start(ac)) != 0)
return(error);
- count = 0;
- /* XXX better timeout? */
- while ((ac->ac_flags & AMR_CMD_BUSY) && (count < 30)) {
- msleep(ac, &ac->ac_sc->amr_io_lock, PRIBIO | PCATCH, "amrwcmd", hz);
+ while ((ac->ac_flags & AMR_CMD_BUSY) && (error != EWOULDBLOCK)) {
+ error = msleep(ac, &ac->ac_sc->amr_io_lock, PRIBIO, "amrwcmd", 0);
}
- return(0);
+ return(error);
}
/********************************************************************************