summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2005-12-16 04:00:36 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2005-12-16 04:00:36 +0000
commit41445faf2e3c27884fb44e1d8c81b96676396401 (patch)
tree183c0877543bce992abfc5252bc1395e8528a530
parent2ec087bc5e48ed2180949775b8da5a68f9febab8 (diff)
Remove autoconf chatter
-rw-r--r--sys/dev/acpi/acpi.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index ce8daa0114b..50a1ca850a4 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.7 2005/12/16 00:08:53 jordan Exp $ */
+/* $OpenBSD: acpi.c,v 1.8 2005/12/16 04:00:35 marco Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@@ -132,10 +132,19 @@ acpi_mapregister(struct acpi_softc *sc, int reg, bus_space_handle_t *ioh)
addr += size;
break;
}
- if (size) {
+ if (size && addr) {
bus_space_map(sc->sc_iot, addr, size, 0, ioh);
+ return size;
+ }
+ return (0);
+}
- return (size);
+void
+acpi_unmapregister(struct acpi_softc *sc, int reg, bus_space_handle_t ioh,
+ int size)
+{
+ if (size)
+ bus_space_unmap(sc->sc_iot, ioh, size);
}
uint32_t
@@ -145,7 +154,6 @@ acpi_read_pm_reg(struct acpi_softc *sc, int reg)
int size;
uint32_t rval;
- rval = 0;
size = acpi_mapregister(sc, reg, &ioh);
switch (size) {
case 1:
@@ -157,9 +165,11 @@ acpi_read_pm_reg(struct acpi_softc *sc, int reg)
case 4:
rval = bus_space_read_4(sc->sc_ioh, ioh, 0);
break;
+ default:
+ rval = 0;
+ break;
}
- if (size)
- bus_space_unmap(sc->sc_iot, ioh, size);
+ acpi_unmapregister(sc, reg, ioh, size);
return rval;
}
@@ -378,8 +388,6 @@ acpiattach(struct device *parent, struct device *self, void *aux)
#endif
}
- printf("attached\n");
-
/*
* ACPI is enabled now -- attach timer
*/