Source-Changes-HG archive

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

[src/trunk]: src/sys/net Don't try to call devsw_attach() for built-in driver...



details:   https://anonhg.NetBSD.org/src/rev/8aad2dbc43a4
branches:  trunk
changeset: 816663:8aad2dbc43a4
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sun Jul 17 01:03:46 2016 +0000

description:
Don't try to call devsw_attach() for built-in driver code.

diffstat:

 sys/net/bpf.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (41 lines):

diff -r 0975fc097cec -r 8aad2dbc43a4 sys/net/bpf.c
--- a/sys/net/bpf.c     Sun Jul 17 00:33:28 2016 +0000
+++ b/sys/net/bpf.c     Sun Jul 17 01:03:46 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bpf.c,v 1.199 2016/06/20 06:46:37 knakahara Exp $      */
+/*     $NetBSD: bpf.c,v 1.200 2016/07/17 01:03:46 pgoyette Exp $       */
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.199 2016/06/20 06:46:37 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.200 2016/07/17 01:03:46 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_bpf.h"
@@ -2112,7 +2112,9 @@
 static int
 bpf_modcmd(modcmd_t cmd, void *arg)
 {
+#ifdef _MODULE
        devmajor_t bmajor, cmajor;
+#endif
        int error;
 
        bmajor = cmajor = NODEVMAJOR;
@@ -2120,10 +2122,12 @@
        switch (cmd) {
        case MODULE_CMD_INIT:
                bpfilterattach(0);
+#ifdef _MODULE
                error = devsw_attach("bpf", NULL, &bmajor,
                    &bpf_cdevsw, &cmajor);
                if (error == EEXIST)
                        error = 0; /* maybe built-in ... improve eventually */
+#endif
                if (error)
                        break;
 



Home | Main Index | Thread Index | Old Index