Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi Convert to config_init/fini_component.
details: https://anonhg.NetBSD.org/src/rev/7c169e209505
branches: trunk
changeset: 753394:7c169e209505
user: pooka <pooka%NetBSD.org@localhost>
date: Fri Mar 26 05:59:26 2010 +0000
description:
Convert to config_init/fini_component.
tested by jruoho
diffstat:
sys/dev/acpi/acpi_bat.c | 41 ++++++-----------------------------------
1 files changed, 6 insertions(+), 35 deletions(-)
diffs (68 lines):
diff -r 3f471a6492cd -r 7c169e209505 sys/dev/acpi/acpi_bat.c
--- a/sys/dev/acpi/acpi_bat.c Thu Mar 25 20:37:36 2010 +0000
+++ b/sys/dev/acpi/acpi_bat.c Fri Mar 26 05:59:26 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_bat.c,v 1.95 2010/03/24 12:18:54 pgoyette Exp $ */
+/* $NetBSD: acpi_bat.c,v 1.96 2010/03/26 05:59:26 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.95 2010/03/24 12:18:54 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.96 2010/03/26 05:59:26 pooka Exp $");
#include <sys/param.h>
#include <sys/condvar.h>
@@ -795,45 +795,16 @@
static int
acpibat_modcmd(modcmd_t cmd, void *context)
{
- int err;
switch (cmd) {
case MODULE_CMD_INIT:
-
- err = config_cfdriver_attach(&acpibat_cd);
-
- if (err != 0)
- return err;
-
- err = config_cfattach_attach("acpibat", &acpibat_ca);
-
- if (err != 0) {
- config_cfdriver_detach(&acpibat_cd);
- return err;
- }
-
- err = config_cfdata_attach(cfdata_acpibat, 1);
-
- if (err != 0) {
- config_cfattach_detach("acpibat", &acpibat_ca);
- config_cfdriver_detach(&acpibat_cd);
- return err;
- }
-
- return 0;
+ return config_init_component(cfdriver_comp_acpibat,
+ cfattach_comp_acpibat, cfdata_acpibat);
case MODULE_CMD_FINI:
-
- err = config_cfdata_detach(cfdata_acpibat);
-
- if (err != 0)
- return err;
-
- config_cfattach_detach("acpibat", &acpibat_ca);
- config_cfdriver_detach(&acpibat_cd);
-
- return 0;
+ return config_fini_component(cfdriver_comp_acpibat,
+ cfattach_comp_acpibat, cfdata_acpibat);
default:
return ENOTTY;
Home |
Main Index |
Thread Index |
Old Index