Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Modularize the ichsmb(4) driver. No functional ...
details: https://anonhg.NetBSD.org/src/rev/4e0ac72d1a7a
branches: trunk
changeset: 359826:4e0ac72d1a7a
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Mon Feb 26 07:28:02 2018 +0000
description:
Modularize the ichsmb(4) driver. No functional changes.
diffstat:
sys/dev/pci/ichsmb.c | 40 ++++++++++++++++++++++++++++++++++++++--
1 files changed, 38 insertions(+), 2 deletions(-)
diffs (72 lines):
diff -r b9a4d91d4f7b -r 4e0ac72d1a7a sys/dev/pci/ichsmb.c
--- a/sys/dev/pci/ichsmb.c Mon Feb 26 06:58:56 2018 +0000
+++ b/sys/dev/pci/ichsmb.c Mon Feb 26 07:28:02 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ichsmb.c,v 1.52 2018/02/22 05:09:56 msaitoh Exp $ */
+/* $NetBSD: ichsmb.c,v 1.53 2018/02/26 07:28:02 pgoyette Exp $ */
/* $OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $ */
/*
@@ -22,7 +22,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.52 2018/02/22 05:09:56 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.53 2018/02/26 07:28:02 pgoyette Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -30,6 +30,7 @@
#include <sys/kernel.h>
#include <sys/mutex.h>
#include <sys/proc.h>
+#include <sys/module.h>
#include <sys/bus.h>
@@ -82,6 +83,7 @@
static int ichsmb_intr(void *);
+#include "ioconf.h"
CFATTACH_DECL3_NEW(ichsmb, sizeof(struct ichsmb_softc),
ichsmb_match, ichsmb_attach, NULL, NULL, ichsmb_rescan, ichsmb_chdet, 0);
@@ -450,3 +452,37 @@
wakeup(sc);
return (1);
}
+
+MODULE(MODULE_CLASS_DRIVER, ichsmb, "pci");
+
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
+
+static int
+ichsmb_modcmd(modcmd_t cmd, void *opaque)
+{
+ int error = 0;
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+#ifdef _MODULE
+ error = config_init_component(cfdriver_ioconf_ichsmb,
+ cfattach_ioconf_ichsmb, cfdata_ioconf_ichsmb);
+#endif
+ break;
+ case MODULE_CMD_FINI:
+#ifdef _MODULE
+ error = config_fini_component(cfdriver_ioconf_ichsmb,
+ cfattach_ioconf_ichsmb, cfdata_ioconf_ichsmb);
+#endif
+ break;
+ default:
+#ifdef _MODULE
+ error = ENOTTY;
+#endif
+ break;
+ }
+
+ return error;
+}
Home |
Main Index |
Thread Index |
Old Index