From 0d3a27d5dcece1dd9c5182fb2ad0e1c6d44e2181 Mon Sep 17 00:00:00 2001 From: jmcneill Date: Sun, 31 Jul 2011 16:18:54 +0000 Subject: [PATCH] modularize --- sys/dev/isa/smsc.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/sys/dev/isa/smsc.c b/sys/dev/isa/smsc.c index 0a077e7347e0..3aba913436d2 100644 --- a/sys/dev/isa/smsc.c +++ b/sys/dev/isa/smsc.c @@ -1,4 +1,4 @@ -/* $NetBSD: smsc.c,v 1.10 2011/06/20 18:12:54 pgoyette Exp $ */ +/* $NetBSD: smsc.c,v 1.11 2011/07/31 16:18:54 jmcneill Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -40,11 +40,12 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: smsc.c,v 1.10 2011/06/20 18:12:54 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smsc.c,v 1.11 2011/07/31 16:18:54 jmcneill Exp $"); #include #include #include +#include #include #include @@ -341,3 +342,32 @@ smsc_refresh(struct sysmon_envsys *sme, envsys_data_t *edata) break; } } + +MODULE(MODULE_CLASS_DRIVER, smsc, NULL); + +#ifdef _MODULE +#include "ioconf.c" +#endif + +static int +smsc_modcmd(modcmd_t cmd, void *opaque) +{ + int error = 0; + + switch (cmd) { + case MODULE_CMD_INIT: +#ifdef _MODULE + error = config_init_component(cfdriver_ioconf_smsc, + cfattach_ioconf_smsc, cfdata_ioconf_smsc); +#endif + return error; + case MODULE_CMD_FINI: +#ifdef _MODULE + error = config_fini_component(cfdriver_ioconf_smsc, + cfattach_ioconf_smsc, cfdata_ioconf_smsc); +#endif + return error; + default: + return ENOTTY; + } +}