Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Make sure not to use the io handle before it's b...



details:   https://anonhg.NetBSD.org/src/rev/3365d561d3c8
branches:  trunk
changeset: 476049:3365d561d3c8
user:      augustss <augustss%NetBSD.org@localhost>
date:      Sat Sep 04 22:00:32 1999 +0000

description:
Make sure not to use the io handle before it's been initialized.

diffstat:

 sys/dev/pci/ohci_pci.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (30 lines):

diff -r 2aa8f2b6e33e -r 3365d561d3c8 sys/dev/pci/ohci_pci.c
--- a/sys/dev/pci/ohci_pci.c    Sat Sep 04 21:48:33 1999 +0000
+++ b/sys/dev/pci/ohci_pci.c    Sat Sep 04 22:00:32 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci_pci.c,v 1.10 1999/08/21 21:35:36 augustss Exp $   */
+/*     $NetBSD: ohci_pci.c,v 1.11 1999/09/04 22:00:32 augustss Exp $   */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -105,10 +105,6 @@
        pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo);
        printf(": %s (rev. 0x%02x)\n", devinfo, PCI_REVISION(pa->pa_class));
 
-       /* Disable interrupts, so we don't can any spurious ones. */
-       bus_space_write_4(sc->iot, sc->ioh, 
-                         OHCI_INTERRUPT_DISABLE, OHCI_ALL_INTRS);
-
        /* Map I/O registers */
        if (pci_mapreg_map(pa, PCI_CBMEM, PCI_MAPREG_TYPE_MEM, 0,
                           &sc->iot, &sc->ioh, NULL, NULL)) {
@@ -116,6 +112,9 @@
                return;
        }
 
+       /* Disable interrupts, so we don't can any spurious ones. */
+       bus_space_write_4(sc->iot, sc->ioh, OHCI_INTERRUPT_DISABLE, OHCI_ALL_INTRS);
+
        sc->sc_dmatag = pa->pa_dmat;
 
        /* Enable the device. */



Home | Main Index | Thread Index | Old Index