Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Initialize sc_iot early enough to avoid a crash ...



details:   https://anonhg.NetBSD.org/src/rev/20a529a77d9e
branches:  trunk
changeset: 759467:20a529a77d9e
user:      phx <phx%NetBSD.org@localhost>
date:      Fri Dec 10 21:20:09 2010 +0000

description:
Initialize sc_iot early enough to avoid a crash when the hardware monitor
function was found disabled.

diffstat:

 sys/dev/pci/viaenv.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 700e354b343f -r 20a529a77d9e sys/dev/pci/viaenv.c
--- a/sys/dev/pci/viaenv.c      Fri Dec 10 20:08:17 2010 +0000
+++ b/sys/dev/pci/viaenv.c      Fri Dec 10 21:20:09 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: viaenv.c,v 1.29 2008/04/30 14:07:14 ad Exp $   */
+/*     $NetBSD: viaenv.c,v 1.30 2010/12/10 21:20:09 phx Exp $  */
 
 /*
  * Copyright (c) 2000 Johan Danielsson
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: viaenv.c,v 1.29 2008/04/30 14:07:14 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: viaenv.c,v 1.30 2010/12/10 21:20:09 phx Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -295,6 +295,8 @@
                break;
        }
 
+       sc->sc_iot = pa->pa_iot;
+
        iobase = pci_conf_read(pa->pa_pc, pa->pa_tag, VIAENV_HWMON_CONF);
        DPRINTF(("%s: iobase 0x%x\n", device_xname(self), iobase));
        control = pci_conf_read(pa->pa_pc, pa->pa_tag, VIAENV_HWMON_CTL);
@@ -306,7 +308,6 @@
        }
 
        /* Map Hardware Monitor I/O space */
-       sc->sc_iot = pa->pa_iot;
        if (bus_space_map(sc->sc_iot, iobase & 0xff80,
            VIAENV_PMSIZE, 0, &sc->sc_ioh)) {
                aprint_error_dev(self, "failed to map I/O space\n");



Home | Main Index | Thread Index | Old Index