Module Name: src
Committed By: pgoyette
Date: Tue May 12 10:20:14 UTC 2015
Modified Files:
src/sys/dev/sysmon: swwdog.c
Log Message:
Finish work started in previous commit. Ensure that initialization
code is only called once for built-in variants of the module.
To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/sysmon/swwdog.c
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/sysmon/swwdog.c
diff -u src/sys/dev/sysmon/swwdog.c:1.18 src/sys/dev/sysmon/swwdog.c:1.19
--- src/sys/dev/sysmon/swwdog.c:1.18 Tue May 12 02:38:00 2015
+++ src/sys/dev/sysmon/swwdog.c Tue May 12 10:20:14 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: swwdog.c,v 1.18 2015/05/12 02:38:00 pgoyette Exp $ */
+/* $NetBSD: swwdog.c,v 1.19 2015/05/12 10:20:14 pgoyette Exp $ */
/*
* Copyright (c) 2004, 2005 Steven M. Bellovin
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: swwdog.c,v 1.18 2015/05/12 02:38:00 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: swwdog.c,v 1.19 2015/05/12 10:20:14 pgoyette Exp $");
/*
*
@@ -309,7 +309,8 @@ swwdog_init(void *arg)
* Merge the driver info into the kernel tables and attach the
* pseudo-device
*/
- int error;
+ int error = 0;
+
#ifdef _MODULE
error = config_cfdriver_attach(&swwdog_cd);
@@ -318,9 +319,7 @@ swwdog_init(void *arg)
swwdog_cd.cd_name);
return error;
}
-#endif
error = swwdogattach(1);
-#ifdef _MODULE
if (error) {
aprint_error("%s: device attach failed\n", swwdog_cd.cd_name);
config_cfdriver_detach(&swwdog_cd);