Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sysmon Finish work started in previous commit. Ensu...



details:   https://anonhg.NetBSD.org/src/rev/01af089c96e4
branches:  trunk
changeset: 338144:01af089c96e4
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Tue May 12 10:20:14 2015 +0000

description:
Finish work started in previous commit.  Ensure that initialization
code is only called once for built-in variants of the module.

diffstat:

 sys/dev/sysmon/swwdog.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r c809d8aec52a -r 01af089c96e4 sys/dev/sysmon/swwdog.c
--- a/sys/dev/sysmon/swwdog.c   Tue May 12 08:25:28 2015 +0000
+++ b/sys/dev/sysmon/swwdog.c   Tue May 12 10:20:14 2015 +0000
@@ -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 @@
         * 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_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);



Home | Main Index | Thread Index | Old Index