From 60e587adbf6cb4331239ca869243579660028500 Mon Sep 17 00:00:00 2001 From: n_hibma Date: Sun, 11 Apr 1999 14:24:20 +0000 Subject: [PATCH] Changed pci_config_read() to pci_map_port(). Pointed out by Doug Rabson. --- sys/dev/usb/uhci_pci.c | 7 +++++-- sys/pci/uhci_pci.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sys/dev/usb/uhci_pci.c b/sys/dev/usb/uhci_pci.c index 501945c14988..6ed3cee0381f 100644 --- a/sys/dev/usb/uhci_pci.c +++ b/sys/dev/usb/uhci_pci.c @@ -1,4 +1,4 @@ -/* FreeBSD $Id: uhci_pci.c,v 1.3 1999/03/27 23:08:43 n_hibma Exp $ */ +/* FreeBSD $Id: uhci_pci.c,v 1.4 1999/04/06 23:09:58 n_hibma Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -141,7 +141,10 @@ uhci_pci_attach(pcici_t config_id, int unit) } memset(sc, 0, sizeof(uhci_softc_t)); - sc->sc_iobase = pci_conf_read(config_id, PCI_UHCI_BASE_REG) & 0xffe0; + if ( !pci_map_port(config_id, PCI_UHCI_BASE_REG, &sc->sc_iobase) ) { + printf("uhci%d: could not map port\n", unit); + return; + } if ( !pci_map_int(config_id, (pci_inthand_t *)uhci_intr, (void *) sc, &bio_imask)) { diff --git a/sys/pci/uhci_pci.c b/sys/pci/uhci_pci.c index 501945c14988..6ed3cee0381f 100644 --- a/sys/pci/uhci_pci.c +++ b/sys/pci/uhci_pci.c @@ -1,4 +1,4 @@ -/* FreeBSD $Id: uhci_pci.c,v 1.3 1999/03/27 23:08:43 n_hibma Exp $ */ +/* FreeBSD $Id: uhci_pci.c,v 1.4 1999/04/06 23:09:58 n_hibma Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -141,7 +141,10 @@ uhci_pci_attach(pcici_t config_id, int unit) } memset(sc, 0, sizeof(uhci_softc_t)); - sc->sc_iobase = pci_conf_read(config_id, PCI_UHCI_BASE_REG) & 0xffe0; + if ( !pci_map_port(config_id, PCI_UHCI_BASE_REG, &sc->sc_iobase) ) { + printf("uhci%d: could not map port\n", unit); + return; + } if ( !pci_map_int(config_id, (pci_inthand_t *)uhci_intr, (void *) sc, &bio_imask)) {