Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netsmb Rather than calling devsw_attach() and ignoring t...
details: https://anonhg.NetBSD.org/src/rev/d8406b5466c5
branches: trunk
changeset: 346518:d8406b5466c5
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Sun Jul 17 00:17:14 2016 +0000
description:
Rather than calling devsw_attach() and ignoring the EEXIST error when
the driver is already built-in to the kernel, don't bother calling.
diffstat:
sys/netsmb/smb_dev.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diffs (42 lines):
diff -r d18adafe7597 -r d8406b5466c5 sys/netsmb/smb_dev.c
--- a/sys/netsmb/smb_dev.c Sat Jul 16 21:33:46 2016 +0000
+++ b/sys/netsmb/smb_dev.c Sun Jul 17 00:17:14 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smb_dev.c,v 1.44 2015/08/20 14:40:19 christos Exp $ */
+/* $NetBSD: smb_dev.c,v 1.45 2016/07/17 00:17:14 pgoyette Exp $ */
/*
* Copyright (c) 2000-2001 Boris Popov
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smb_dev.c,v 1.44 2015/08/20 14:40:19 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_dev.c,v 1.45 2016/07/17 00:17:14 pgoyette Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -378,19 +378,23 @@
switch (cmd) {
case MODULE_CMD_INIT:
nsmbattach(1);
+#ifdef _MODULE
error =
devsw_attach("nsmb", NULL, &bmajor, &nsmb_cdevsw, &cmajor);
if (error == EEXIST) /* builtin */
error = 0;
+#endif
if (error) {
nsmbdetach();
}
break;
case MODULE_CMD_FINI:
+#ifdef _MODULE
error = devsw_detach(NULL, &nsmb_cdevsw);
if (error)
break;
+#endif
nsmbdetach();
break;
default:
Home |
Main Index |
Thread Index |
Old Index