diff options
| author | pgoyette <pgoyette@NetBSD.org> | 2015-05-12 10:20:14 +0000 |
|---|---|---|
| committer | pgoyette <pgoyette@NetBSD.org> | 2015-05-12 10:20:14 +0000 |
| commit | 65ff522b154fb97d591eb95c1a5d8dd3bcd1cbe6 (patch) | |
| tree | 9e78ce1d639e8f8198f951bd9ad31a0cb3bb32e9 /sys/dev/sysmon | |
| parent | 108cc17229e7699bc253d0c799cfda0fcbab5e15 (diff) | |
Finish work started in previous commit. Ensure that initialization
code is only called once for built-in variants of the module.
Diffstat (limited to 'sys/dev/sysmon')
| -rw-r--r-- | sys/dev/sysmon/swwdog.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/sysmon/swwdog.c b/sys/dev/sysmon/swwdog.c index 4b0015dd417..36391c17d9b 100644 --- a/sys/dev/sysmon/swwdog.c +++ b/sys/dev/sysmon/swwdog.c @@ -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); |
