Module Name:    src
Committed By:   matt
Date:           Sun Sep  8 11:19:48 UTC 2013

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

Log Message:
If there is only 1 port, don't say "1 ports".
Add a debug printf after reading the active ports.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/ic/ahcisata_core.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/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.48 src/sys/dev/ic/ahcisata_core.c:1.49
--- src/sys/dev/ic/ahcisata_core.c:1.48	Sat Jun 22 05:41:25 2013
+++ src/sys/dev/ic/ahcisata_core.c	Sun Sep  8 11:19:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.48 2013/06/22 05:41:25 matt Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.49 2013/09/08 11:19:47 matt Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.48 2013/06/22 05:41:25 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.49 2013/09/08 11:19:47 matt Exp $");
 
 #include <sys/types.h>
 #include <sys/malloc.h>
@@ -259,9 +259,11 @@ ahci_attach(struct ahci_softc *sc)
 			"b\037S64A\0"
 			"\0", sc->sc_ahci_cap);
 	aprint_normal_dev(sc->sc_atac.atac_dev, "AHCI revision %u.%u"
-	    ", %d ports, %d slots, CAP %s\n",
+	    ", %d port%s, %d slot%s, CAP %s\n",
 	    AHCI_VS_MJR(ahci_rev), AHCI_VS_MNR(ahci_rev),
-	    sc->sc_atac.atac_nchannels, sc->sc_ncmds, buf);
+	    sc->sc_atac.atac_nchannels,
+	    (sc->sc_atac.atac_nchannels == 1 ? "" : "s"), 
+	    sc->sc_ncmds, (sc->sc_ncmds == 1 ? "" : "s"), buf);
 
 	sc->sc_atac.atac_cap = ATAC_CAP_DATA16 | ATAC_CAP_DMA | ATAC_CAP_UDMA;
 	sc->sc_atac.atac_cap |= sc->sc_atac_capflags;
@@ -312,6 +314,7 @@ ahci_attach(struct ahci_softc *sc)
 	ahci_enable_intrs(sc);
 
 	ahci_ports = AHCI_READ(sc, AHCI_PI);
+	AHCIDEBUG_PRINT(("active ports %#x\n", ahci_ports), DEBUG_PROBE);
 	for (i = 0, port = 0; i < AHCI_MAX_PORTS; i++) {
 		if ((ahci_ports & (1 << i)) == 0)
 			continue;

Reply via email to