-/* $OpenBSD: acpi.c,v 1.196 2010/07/28 07:32:16 mlarkin Exp $ */
+/* $OpenBSD: acpi.c,v 1.197 2010/07/28 14:39:43 marco Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
/* read/write from I/O registers */
ioaddr = address;
if (acpi_bus_space_map(sc->sc_iot, ioaddr, len, 0, &ioh) != 0) {
- printf("unable to map iospace\n");
+ printf("%s: unable to map iospace\n", DEVNAME(sc));
return (-1);
}
for (reg = 0; reg < len; reg += access_size) {
sc->sc_iot, ioh, reg);
break;
default:
- printf("rdio: invalid size %d\n", access_size);
- break;
+ printf("%s: rdio: invalid size %d\n",
+ DEVNAME(sc), access_size);
+ return (-1);
}
} else {
switch (access_size) {
*(uint32_t *)(pb+reg));
break;
default:
- printf("wrio: invalid size %d\n", access_size);
- break;
+ printf("%s: wrio: invalid size %d\n",
+ DEVNAME(sc), access_size);
+ return (-1);
}
}
pb++;
}
break;
+
case GAS_EMBEDDED:
- if (sc->sc_ec == NULL)
- break;
+ if (sc->sc_ec == NULL) {
+ printf("%s: WARNING EC not initialized\n", DEVNAME(sc));
+ return (-1);
+ }
#ifndef SMALL_KERNEL
if (iodir == ACPI_IOREAD)
acpiec_read(sc->sc_ec, (u_int8_t)address, len, buffer);