Module Name:    src
Committed By:   jmcneill
Date:           Thu Jun  8 10:40:13 UTC 2017

Modified Files:
        src/sys/dev/ic: pl041.c

Log Message:
Fix two bugs:
 - Inverted test for fifo status in aaci_write_data
 - Return success from trigger_output (thanks nat)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/ic/pl041.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/pl041.c
diff -u src/sys/dev/ic/pl041.c:1.1 src/sys/dev/ic/pl041.c:1.2
--- src/sys/dev/ic/pl041.c:1.1	Thu Jun  8 10:02:39 2017
+++ src/sys/dev/ic/pl041.c	Thu Jun  8 10:40:13 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: pl041.c,v 1.1 2017/06/08 10:02:39 jmcneill Exp $ */
+/* $NetBSD: pl041.c,v 1.2 2017/06/08 10:40:13 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcne...@invisible.ca>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pl041.c,v 1.1 2017/06/08 10:02:39 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pl041.c,v 1.2 2017/06/08 10:40:13 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -105,7 +105,7 @@ aaci_write_data(struct aaci_softc *sc)
 	if (sc->sc_pint == NULL)
 		return;
 
-	while ((AACI_READ(sc, AACISR) & AACISR_TXHE) == 0) {
+	while ((AACI_READ(sc, AACISR) & AACISR_TXHE) != 0) {
 		const int len = min(AACI_FIFO_DEPTH / 2, min(sc->sc_pblkresid,
 		    (uintptr_t)sc->sc_pend - (uintptr_t)sc->sc_pcur));
 		KASSERT((len & 3) == 0);
@@ -205,7 +205,7 @@ aaci_trigger_output(void *priv, void *st
 	    AACITXCR_TXCM | AACITXCR_TSIZE_16 |
 	    AACITXCR_TX(3) | AACITXCR_TX(4));
 
-	return ENXIO;
+	return 0;
 }
 
 static int

Reply via email to