svn commit: r219983 - head/sys/dev/usb/controller

Hans Petter Selasky hselasky at FreeBSD.org
Fri Mar 25 10:11:22 UTC 2011


Author: hselasky
Date: Fri Mar 25 10:11:21 2011
New Revision: 219983
URL: http://svn.freebsd.org/changeset/base/219983

Log:
  Fix initialisation order with regard to debug prints.
  
  Reported by:	Luiz Otavio O Souza
  MFC after:	14 days
  Approved by:	thompsa (mentor)

Modified:
  head/sys/dev/usb/controller/ehci.c

Modified: head/sys/dev/usb/controller/ehci.c
==============================================================================
--- head/sys/dev/usb/controller/ehci.c	Fri Mar 25 05:01:13 2011	(r219982)
+++ head/sys/dev/usb/controller/ehci.c	Fri Mar 25 10:11:21 2011	(r219983)
@@ -259,6 +259,8 @@ ehci_init(ehci_softc_t *sc)
 	usb_callout_init_mtx(&sc->sc_tmo_pcd, &sc->sc_bus.bus_mtx, 0);
 	usb_callout_init_mtx(&sc->sc_tmo_poll, &sc->sc_bus.bus_mtx, 0);
 
+	sc->sc_offs = EHCI_CAPLENGTH(EREAD4(sc, EHCI_CAPLEN_HCIVERSION));
+
 #ifdef USB_DEBUG
 	if (ehciiaadbug)
 		sc->sc_flags |= EHCI_SCFLG_IAADBUG;
@@ -269,8 +271,6 @@ ehci_init(ehci_softc_t *sc)
 	}
 #endif
 
-	sc->sc_offs = EHCI_CAPLENGTH(EREAD4(sc, EHCI_CAPLEN_HCIVERSION));
-
 	version = EHCI_HCIVERSION(EREAD4(sc, EHCI_CAPLEN_HCIVERSION));
 	device_printf(sc->sc_bus.bdev, "EHCI version %x.%x\n",
 	    version >> 8, version & 0xff);


More information about the svn-src-all mailing list