summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2008-05-01 13:36:10 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2008-05-01 13:36:10 +0000
commitffe637e63e3912746cf6a3cc9ab37e8c0a9c44b1 (patch)
tree23e65194b3204e6b000c886d34b17df85d89e219 /sys
parentc14607a8c6204f88474f5ca4fdd69dc81d6a319b (diff)
Don't forget to bus_space_unmap() after probing for a com chip.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sgi/dev/com_ioc.c3
-rw-r--r--sys/arch/sgi/localbus/com_lbus.c8
2 files changed, 8 insertions, 3 deletions
diff --git a/sys/arch/sgi/dev/com_ioc.c b/sys/arch/sgi/dev/com_ioc.c
index eae07cb9489..abab9713721 100644
--- a/sys/arch/sgi/dev/com_ioc.c
+++ b/sys/arch/sgi/dev/com_ioc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com_ioc.c,v 1.1 2008/04/07 22:53:55 miod Exp $ */
+/* $OpenBSD: com_ioc.c,v 1.2 2008/05/01 13:36:08 miod Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -64,6 +64,7 @@ com_ioc_probe(struct device *parent, void *match, void *aux)
if (!(console && !comconsattached)) {
bus_space_map(iot, iaa->iaa_base, COM_NPORTS, 0, &ioh);
rv = comprobe1(iot, ioh);
+ bus_space_unmap(iot, ioh, COM_NPORTS);
} else
rv = 1;
diff --git a/sys/arch/sgi/localbus/com_lbus.c b/sys/arch/sgi/localbus/com_lbus.c
index 44e254a5a4b..825fa71c667 100644
--- a/sys/arch/sgi/localbus/com_lbus.c
+++ b/sys/arch/sgi/localbus/com_lbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com_lbus.c,v 1.6 2008/03/27 14:38:17 jsing Exp $ */
+/* $OpenBSD: com_lbus.c,v 1.7 2008/05/01 13:36:09 miod Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -55,6 +55,7 @@ com_macebus_probe(struct device *parent, void *match, void *aux)
{
struct confargs *ca = aux;
bus_space_handle_t ioh;
+ int rv;
/* If it's in use as the console, then it's there. */
if (ca->ca_baseaddr == comconsaddr && !comconsattached)
@@ -63,7 +64,10 @@ com_macebus_probe(struct device *parent, void *match, void *aux)
if (bus_space_map(ca->ca_iot, ca->ca_baseaddr, COM_NPORTS, 0, &ioh))
return (0);
- return comprobe1(ca->ca_iot, ioh);
+ rv = comprobe1(ca->ca_iot, ioh);
+ bus_space_unmap(ca->ca_iot, ioh, COM_NPORTS);
+
+ return rv;
}
void