Module Name:    src
Committed By:   msaitoh
Date:           Wed Jul 15 03:54:53 UTC 2015

Modified Files:
        src/sys/dev/pci: ehci_pci.c

Log Message:
 Initialize some members little earlier. It's not a bug.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/pci/ehci_pci.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/pci/ehci_pci.c
diff -u src/sys/dev/pci/ehci_pci.c:1.59 src/sys/dev/pci/ehci_pci.c:1.60
--- src/sys/dev/pci/ehci_pci.c:1.59	Sun Sep 21 14:30:22 2014
+++ src/sys/dev/pci/ehci_pci.c	Wed Jul 15 03:54:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci_pci.c,v 1.59 2014/09/21 14:30:22 christos Exp $	*/
+/*	$NetBSD: ehci_pci.c,v 1.60 2015/07/15 03:54:53 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.59 2014/09/21 14:30:22 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.60 2015/07/15 03:54:53 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -142,15 +142,15 @@ ehci_pci_attach(device_t parent, device_
 		return;
 	}
 
+	sc->sc_pc = pc;
+	sc->sc_tag = tag;
+	sc->sc.sc_bus.dmatag = pa->pa_dmat;
+
 	/* Disable interrupts, so we don't get any spurious ones. */
 	sc->sc.sc_offs = EREAD1(&sc->sc, EHCI_CAPLENGTH);
 	DPRINTF(("%s: offs=%d\n", device_xname(self), sc->sc.sc_offs));
 	EOWRITE4(&sc->sc, EHCI_USBINTR, 0);
 
-	sc->sc_pc = pc;
-	sc->sc_tag = tag;
-	sc->sc.sc_bus.dmatag = pa->pa_dmat;
-
 	/* Handle quirks */
 	switch (quirk) {
 	case EHCI_PCI_QUIRK_AMD_SB600:
@@ -325,7 +325,7 @@ ehci_dump_caps(ehci_softc_t *sc, pci_chi
 		switch (id) {
 		case EHCI_CAP_ID_LEGACY:
 			legctlsts = pci_conf_read(pc, tag,
-						  addr + PCI_EHCI_USBLEGCTLSTS);
+			    addr + PCI_EHCI_USBLEGCTLSTS);
 			printf("ehci_dump_caps: legsup=0x%08x "
 			       "legctlsts=0x%08x\n", cap, legctlsts);
 			break;

Reply via email to