summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorpooka <pooka@NetBSD.org>2010-03-21 07:09:56 +0000
committerpooka <pooka@NetBSD.org>2010-03-21 07:09:56 +0000
commitf3beefdb45fa2da92854cc0a3de92b68d297a15b (patch)
tree74cca844e65afcd01fc352c7d32057719591d390 /sys
parentce672f239f64242a77100d433abd0f3d036cf5b5 (diff)
Convert acpibat to use ioconf instead of homerolled config glue.
Note, config whines about things like: files.acpi:30: attaching undefined device `apm' I intentionally was a lazy boy and didn't include a ton of dirt to keep the hot napalm and riot blasts in the config thread rolling ;) tested by jruoho (thanks!)
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/acpi/acpi_bat.c30
-rw-r--r--sys/modules/acpibat/ACPIBAT.ioconf10
-rw-r--r--sys/modules/acpibat/Makefile3
3 files changed, 17 insertions, 26 deletions
diff --git a/sys/dev/acpi/acpi_bat.c b/sys/dev/acpi/acpi_bat.c
index 8e8f61406d3..df11d79a577 100644
--- a/sys/dev/acpi/acpi_bat.c
+++ b/sys/dev/acpi/acpi_bat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_bat.c,v 1.91 2010/03/17 11:07:59 jruoho Exp $ */
+/* $NetBSD: acpi_bat.c,v 1.92 2010/03/21 07:09:56 pooka Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.91 2010/03/17 11:07:59 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.92 2010/03/21 07:09:56 pooka Exp $");
#include <sys/param.h>
#include <sys/condvar.h>
@@ -789,28 +789,8 @@ acpibat_get_limits(struct sysmon_envsys *sme, envsys_data_t *edata,
#ifdef _MODULE
MODULE(MODULE_CLASS_DRIVER, acpibat, NULL);
-CFDRIVER_DECL(acpibat, DV_DULL, NULL);
-static int acpibatloc[] = { -1 };
-extern struct cfattach acpibat_ca;
-
-static struct cfparent acpiparent = {
- "acpinodebus", NULL, DVUNIT_ANY
-};
-
-static struct cfdata acpibat_cfdata[] = {
- {
- .cf_name = "acpibat",
- .cf_atname = "acpibat",
- .cf_unit = 0,
- .cf_fstate = FSTATE_STAR,
- .cf_loc = acpibatloc,
- .cf_flags = 0,
- .cf_pspec = &acpiparent,
- },
-
- { NULL }
-};
+#include "ioconf.c"
static int
acpibat_modcmd(modcmd_t cmd, void *context)
@@ -833,7 +813,7 @@ acpibat_modcmd(modcmd_t cmd, void *context)
return err;
}
- err = config_cfdata_attach(acpibat_cfdata, 1);
+ err = config_cfdata_attach(cfdata_acpibat, 1);
if (err != 0) {
config_cfattach_detach("acpibat", &acpibat_ca);
@@ -845,7 +825,7 @@ acpibat_modcmd(modcmd_t cmd, void *context)
case MODULE_CMD_FINI:
- err = config_cfdata_detach(acpibat_cfdata);
+ err = config_cfdata_detach(cfdata_acpibat);
if (err != 0)
return err;
diff --git a/sys/modules/acpibat/ACPIBAT.ioconf b/sys/modules/acpibat/ACPIBAT.ioconf
new file mode 100644
index 00000000000..9f7671153a8
--- /dev/null
+++ b/sys/modules/acpibat/ACPIBAT.ioconf
@@ -0,0 +1,10 @@
+# $NetBSD: ACPIBAT.ioconf,v 1.1 2010/03/21 07:09:56 pooka Exp $
+
+ioconf acpibat
+
+include "conf/files"
+include "dev/acpi/files.acpi"
+
+pseudo-root acpi*
+
+acpibat* at acpi?
diff --git a/sys/modules/acpibat/Makefile b/sys/modules/acpibat/Makefile
index 7cd1d38e5d1..118f8c57e60 100644
--- a/sys/modules/acpibat/Makefile
+++ b/sys/modules/acpibat/Makefile
@@ -1,10 +1,11 @@
-# $NetBSD: Makefile,v 1.1 2010/02/28 17:40:51 jruoho Exp $
+# $NetBSD: Makefile,v 1.2 2010/03/21 07:09:56 pooka Exp $
.include "../Makefile.inc"
.PATH: ${S}/dev/acpi
KMOD= acpibat
+IOCONF= ACPIBAT.ioconf
SRCS= acpi_bat.c
.include <bsd.kmodule.mk>