Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/dtv allow this to be compiled into the kernel



details:   https://anonhg.NetBSD.org/src/rev/acaeada5c745
branches:  trunk
changeset: 767144:acaeada5c745
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Jul 09 19:24:10 2011 +0000

description:
allow this to be compiled into the kernel

diffstat:

 sys/dev/dtv/dtv_device.c |  21 ++++++++++++++++++---
 sys/dev/dtv/dtvmodule.h  |  45 ---------------------------------------------
 2 files changed, 18 insertions(+), 48 deletions(-)

diffs (123 lines):

diff -r 1b48012dd13d -r acaeada5c745 sys/dev/dtv/dtv_device.c
--- a/sys/dev/dtv/dtv_device.c  Sat Jul 09 17:55:20 2011 +0000
+++ b/sys/dev/dtv/dtv_device.c  Sat Jul 09 19:24:10 2011 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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;
        }
diff -r 1b48012dd13d -r acaeada5c745 sys/dev/dtv/dtvmodule.h
--- a/sys/dev/dtv/dtvmodule.h   Sat Jul 09 17:55:20 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/* $NetBSD: dtvmodule.h,v 1.1 2011/07/09 14:46:56 jmcneill Exp $ */
-
-/*-
- * Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by Jared D. McNeill.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _DEV_DTV_DTVMODULE_H
-#define _DEV_DTV_DTVMODULE_H
-
-#ifdef _MODULE
-#include "ioconf.c"
-#else
-#define config_init_component(xxx)     0
-#define        config_fini_component(xxx)      0
-#endif
-
-#endif /* !_DEV_DTV_DTVMODULE_H */



Home | Main Index | Thread Index | Old Index