Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Convert acpibat to use ioconf instead of homerolled conf...



details:   https://anonhg.NetBSD.org/src/rev/767989d9dff9
branches:  trunk
changeset: 753231:767989d9dff9
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sun Mar 21 07:09:56 2010 +0000

description:
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:

 sys/dev/acpi/acpi_bat.c            |  30 +++++-------------------------
 sys/modules/acpibat/ACPIBAT.ioconf |  10 ++++++++++
 sys/modules/acpibat/Makefile       |   3 ++-
 3 files changed, 17 insertions(+), 26 deletions(-)

diffs (96 lines):

diff -r e05e55f14730 -r 767989d9dff9 sys/dev/acpi/acpi_bat.c
--- a/sys/dev/acpi/acpi_bat.c   Sun Mar 21 06:56:52 2010 +0000
+++ b/sys/dev/acpi/acpi_bat.c   Sun Mar 21 07:09:56 2010 +0000
@@ -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 @@
 #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 @@
                        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 @@
 
        case MODULE_CMD_FINI:
 
-               err = config_cfdata_detach(acpibat_cfdata);
+               err = config_cfdata_detach(cfdata_acpibat);
 
                if (err != 0)
                        return err;
diff -r e05e55f14730 -r 767989d9dff9 sys/modules/acpibat/ACPIBAT.ioconf
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/modules/acpibat/ACPIBAT.ioconf        Sun Mar 21 07:09:56 2010 +0000
@@ -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 -r e05e55f14730 -r 767989d9dff9 sys/modules/acpibat/Makefile
--- a/sys/modules/acpibat/Makefile      Sun Mar 21 06:56:52 2010 +0000
+++ b/sys/modules/acpibat/Makefile      Sun Mar 21 07:09:56 2010 +0000
@@ -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>



Home | Main Index | Thread Index | Old Index