Module Name:    src
Committed By:   jmcneill
Date:           Sat Jul  9 19:24:11 UTC 2011

Modified Files:
        src/sys/dev/dtv: dtv_device.c
Removed Files:
        src/sys/dev/dtv: dtvmodule.h

Log Message:
allow this to be compiled into the kernel


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/dtv/dtv_device.c
cvs rdiff -u -r1.1 -r0 src/sys/dev/dtv/dtvmodule.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/dtv/dtv_device.c
diff -u src/sys/dev/dtv/dtv_device.c:1.2 src/sys/dev/dtv/dtv_device.c:1.3
--- src/sys/dev/dtv/dtv_device.c:1.2	Sat Jul  9 17:55:20 2011
+++ src/sys/dev/dtv/dtv_device.c	Sat Jul  9 19:24:10 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: dtv_device.c,v 1.2 2011/07/09 17:55:20 jmcneill Exp $ */
+/* $NetBSD: dtv_device.c,v 1.3 2011/07/09 19:24:10 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill <[email protected]>
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dtv_device.c,v 1.2 2011/07/09 17:55:20 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dtv_device.c,v 1.3 2011/07/09 19:24:10 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/conf.h>
@@ -44,7 +44,6 @@
 #include <sys/select.h>
 
 #include <dev/dtv/dtvvar.h>
-#include <dev/dtv/dtvmodule.h>
 
 MODULE(MODULE_CLASS_DRIVER, dtv, NULL);
 
@@ -75,6 +74,8 @@
     NULL
 );
 
+extern struct cfdriver dtv_cd;
+
 static int
 dtv_match(device_t parent, cfdata_t cfdata, void *aa)
 {
@@ -144,13 +145,20 @@
 	return 0;
 }
 
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
+
 static int
 dtv_modcmd(modcmd_t cmd, void *arg)
 {
+#ifdef _MODULE
 	int error, bmaj = -1, cmaj = -1;
+#endif
 
 	switch (cmd) {
 	case MODULE_CMD_INIT:
+#ifdef _MODULE
 		error = config_init_component(cfdriver_ioconf_dtv,
 		    cfattach_ioconf_dtv, cfdata_ioconf_dtv);
 		if (error)
@@ -160,10 +168,17 @@
 			config_fini_component(cfdriver_ioconf_dtv,
 			    cfattach_ioconf_dtv, cfdata_ioconf_dtv);
 		return error;
+#else
+		return 0;
+#endif
 	case MODULE_CMD_FINI:
+#ifdef _MODULE
 		devsw_detach(NULL, &dtv_cdevsw);
 		return config_fini_component(cfdriver_ioconf_dtv,
 		    cfattach_ioconf_dtv, cfdata_ioconf_dtv);
+#else
+		return 0;
+#endif
 	default:
 		return ENOTTY;
 	}

Reply via email to