aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ida/ida_pci.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/ida/ida_pci.c b/sys/dev/ida/ida_pci.c
index 82ecf4ad066b..105331792331 100644
--- a/sys/dev/ida/ida_pci.c
+++ b/sys/dev/ida/ida_pci.c
@@ -74,7 +74,13 @@ ida_v3_submit(struct ida_softc *ida, struct ida_qcb *qcb)
static bus_addr_t
ida_v3_done(struct ida_softc *ida)
{
- return (ida_inl(ida, R_DONE_FIFO));
+ bus_addr_t completed;
+
+ completed = ida_inl(ida, R_DONE_FIFO);
+ if (completed == -1) {
+ return (0); /* fifo is empty */
+ }
+ return (completed);
}
static int