From e1766aacfa36dad0346781d1b6b45248b50866c4 Mon Sep 17 00:00:00 2001 From: augustss Date: Sat, 4 Sep 1999 22:00:32 +0000 Subject: [PATCH] Make sure not to use the io handle before it's been initialized. --- sys/dev/pci/ohci_pci.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/dev/pci/ohci_pci.c b/sys/dev/pci/ohci_pci.c index d54bc62073a3..d159d1683d43 100644 --- a/sys/dev/pci/ohci_pci.c +++ b/sys/dev/pci/ohci_pci.c @@ -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 @@ ohci_pci_attach(parent, self, aux) 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 @@ ohci_pci_attach(parent, self, aux) 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. */