Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Use ioconf for the module declarations.
details: https://anonhg.NetBSD.org/src/rev/69196c1eda31
branches: trunk
changeset: 762123:69196c1eda31
user: jruoho <jruoho%NetBSD.org@localhost>
date: Wed Feb 16 08:35:51 2011 +0000
description:
Use ioconf for the module declarations.
diffstat:
sys/dev/acpi/acpi_acad.c | 80 +++++++++---------------------------
sys/dev/acpi/acpi_button.c | 80 +++++++++---------------------------
sys/dev/acpi/acpi_cpu.c | 80 +++++++++---------------------------
sys/dev/acpi/acpi_lid.c | 80 +++++++++---------------------------
sys/dev/acpi/thinkpad_acpi.c | 80 +++++++++---------------------------
sys/modules/acpiacad/Makefile | 3 +-
sys/modules/acpiacad/acpiacad.ioconf | 10 ++++
sys/modules/acpibut/Makefile | 3 +-
sys/modules/acpibut/acpibut.ioconf | 10 ++++
sys/modules/acpicpu/Makefile | 3 +-
sys/modules/acpicpu/acpicpu.ioconf | 10 ++++
sys/modules/acpilid/Makefile | 3 +-
sys/modules/acpilid/acpilid.ioconf | 10 ++++
sys/modules/thinkpad/Makefile | 3 +-
sys/modules/thinkpad/thinkpad.ioconf | 10 ++++
15 files changed, 160 insertions(+), 305 deletions(-)
diffs (truncated from 726 to 300 lines):
diff -r ba46bd13a271 -r 69196c1eda31 sys/dev/acpi/acpi_acad.c
--- a/sys/dev/acpi/acpi_acad.c Wed Feb 16 08:19:56 2011 +0000
+++ b/sys/dev/acpi/acpi_acad.c Wed Feb 16 08:35:51 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_acad.c,v 1.48 2011/01/04 05:48:48 jruoho Exp $ */
+/* $NetBSD: acpi_acad.c,v 1.49 2011/02/16 08:35:51 jruoho Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_acad.c,v 1.48 2011/01/04 05:48:48 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_acad.c,v 1.49 2011/02/16 08:35:51 jruoho Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -295,78 +295,38 @@
sc->sc_sme = NULL;
}
-#ifdef _MODULE
-
MODULE(MODULE_CLASS_DRIVER, acpiacad, NULL);
-CFDRIVER_DECL(acpiacad, DV_DULL, NULL);
-
-static int acpiacadloc[] = { -1 };
-extern struct cfattach acpiacad_ca;
-
-static struct cfparent acpiparent = {
- "acpinodebus", NULL, DVUNIT_ANY
-};
-static struct cfdata acpiacad_cfdata[] = {
- {
- .cf_name = "acpiacad",
- .cf_atname = "acpiacad",
- .cf_unit = 0,
- .cf_fstate = FSTATE_STAR,
- .cf_loc = acpiacadloc,
- .cf_flags = 0,
- .cf_pspec = &acpiparent,
- },
-
- { NULL, NULL, 0, 0, NULL, 0, NULL }
-};
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
static int
-acpiacad_modcmd(modcmd_t cmd, void *context)
+acpiacad_modcmd(modcmd_t cmd, void *aux)
{
- int err;
+ int rv = 0;
switch (cmd) {
case MODULE_CMD_INIT:
- err = config_cfdriver_attach(&acpiacad_cd);
-
- if (err != 0)
- return err;
-
- err = config_cfattach_attach("acpiacad", &acpiacad_ca);
-
- if (err != 0) {
- config_cfdriver_detach(&acpiacad_cd);
- return err;
- }
-
- err = config_cfdata_attach(acpiacad_cfdata, 1);
-
- if (err != 0) {
- config_cfattach_detach("acpiacad", &acpiacad_ca);
- config_cfdriver_detach(&acpiacad_cd);
- return err;
- }
-
- return 0;
+#ifdef _MODULE
+ rv = config_init_component(cfdriver_ioconf_acpiacad,
+ cfattach_ioconf_acpiacad, cfdata_ioconf_acpiacad);
+#endif
+ break;
case MODULE_CMD_FINI:
- err = config_cfdata_detach(acpiacad_cfdata);
-
- if (err != 0)
- return err;
-
- config_cfattach_detach("acpiacad", &acpiacad_ca);
- config_cfdriver_detach(&acpiacad_cd);
-
- return 0;
+#ifdef _MODULE
+ rv = config_fini_component(cfdriver_ioconf_acpiacad,
+ cfattach_ioconf_acpiacad, cfdata_ioconf_acpiacad);
+#endif
+ break;
default:
- return ENOTTY;
+ rv = ENOTTY;
}
+
+ return rv;
}
-
-#endif /* _MODULE */
diff -r ba46bd13a271 -r 69196c1eda31 sys/dev/acpi/acpi_button.c
--- a/sys/dev/acpi/acpi_button.c Wed Feb 16 08:19:56 2011 +0000
+++ b/sys/dev/acpi/acpi_button.c Wed Feb 16 08:35:51 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_button.c,v 1.39 2010/10/25 07:48:03 jruoho Exp $ */
+/* $NetBSD: acpi_button.c,v 1.40 2011/02/16 08:35:51 jruoho Exp $ */
/*
* Copyright 2001, 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_button.c,v 1.39 2010/10/25 07:48:03 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_button.c,v 1.40 2011/02/16 08:35:51 jruoho Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -191,78 +191,38 @@
}
}
-#ifdef _MODULE
-
MODULE(MODULE_CLASS_DRIVER, acpibut, NULL);
-CFDRIVER_DECL(acpibut, DV_DULL, NULL);
-
-static int acpibutloc[] = { -1 };
-extern struct cfattach acpibut_ca;
-
-static struct cfparent acpiparent = {
- "acpinodebus", NULL, DVUNIT_ANY
-};
-static struct cfdata acpibut_cfdata[] = {
- {
- .cf_name = "acpibut",
- .cf_atname = "acpibut",
- .cf_unit = 0,
- .cf_fstate = FSTATE_STAR,
- .cf_loc = acpibutloc,
- .cf_flags = 0,
- .cf_pspec = &acpiparent,
- },
-
- { NULL, NULL, 0, 0, NULL, 0, NULL }
-};
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
static int
-acpibut_modcmd(modcmd_t cmd, void *context)
+acpibut_modcmd(modcmd_t cmd, void *aux)
{
- int err;
+ int rv = 0;
switch (cmd) {
case MODULE_CMD_INIT:
- err = config_cfdriver_attach(&acpibut_cd);
-
- if (err != 0)
- return err;
-
- err = config_cfattach_attach("acpibut", &acpibut_ca);
-
- if (err != 0) {
- config_cfdriver_detach(&acpibut_cd);
- return err;
- }
-
- err = config_cfdata_attach(acpibut_cfdata, 1);
-
- if (err != 0) {
- config_cfattach_detach("acpibut", &acpibut_ca);
- config_cfdriver_detach(&acpibut_cd);
- return err;
- }
-
- return 0;
+#ifdef _MODULE
+ rv = config_init_component(cfdriver_ioconf_acpibut,
+ cfattach_ioconf_acpibut, cfdata_ioconf_acpibut);
+#endif
+ break;
case MODULE_CMD_FINI:
- err = config_cfdata_detach(acpibut_cfdata);
-
- if (err != 0)
- return err;
-
- config_cfattach_detach("acpibut", &acpibut_ca);
- config_cfdriver_detach(&acpibut_cd);
-
- return 0;
+#ifdef _MODULE
+ rv = config_fini_component(cfdriver_ioconf_acpibut,
+ cfattach_ioconf_acpibut, cfdata_ioconf_acpibut);
+#endif
+ break;
default:
- return ENOTTY;
+ rv = ENOTTY;
}
+
+ return rv;
}
-
-#endif /* _MODULE */
diff -r ba46bd13a271 -r 69196c1eda31 sys/dev/acpi/acpi_cpu.c
--- a/sys/dev/acpi/acpi_cpu.c Wed Feb 16 08:19:56 2011 +0000
+++ b/sys/dev/acpi/acpi_cpu.c Wed Feb 16 08:35:51 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu.c,v 1.25 2011/01/13 04:18:19 jruoho Exp $ */
+/* $NetBSD: acpi_cpu.c,v 1.26 2011/02/16 08:35:51 jruoho Exp $ */
/*-
* Copyright (c) 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu.c,v 1.25 2011/01/13 04:18:19 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu.c,v 1.26 2011/02/16 08:35:51 jruoho Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@@ -628,78 +628,38 @@
return true;
}
-#ifdef _MODULE
-
MODULE(MODULE_CLASS_DRIVER, acpicpu, NULL);
-CFDRIVER_DECL(acpicpu, DV_DULL, NULL);
-
-static int acpicpuloc[] = { -1 };
-extern struct cfattach acpicpu_ca;
-
-static struct cfparent acpiparent = {
- "acpinodebus", NULL, DVUNIT_ANY
-};
-static struct cfdata acpicpu_cfdata[] = {
- {
- .cf_name = "acpicpu",
- .cf_atname = "acpicpu",
- .cf_unit = 0,
- .cf_fstate = FSTATE_STAR,
- .cf_loc = acpicpuloc,
- .cf_flags = 0,
- .cf_pspec = &acpiparent,
- },
-
- { NULL, NULL, 0, 0, NULL, 0, NULL }
-};
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
static int
-acpicpu_modcmd(modcmd_t cmd, void *context)
+acpicpu_modcmd(modcmd_t cmd, void *aux)
{
- int err;
+ int rv = 0;
switch (cmd) {
case MODULE_CMD_INIT:
- err = config_cfdriver_attach(&acpicpu_cd);
-
- if (err != 0)
- return err;
-
- err = config_cfattach_attach("acpicpu", &acpicpu_ca);
-
- if (err != 0) {
Home |
Main Index |
Thread Index |
Old Index