From 65ff522b154fb97d591eb95c1a5d8dd3bcd1cbe6 Mon Sep 17 00:00:00 2001 From: pgoyette Date: Tue, 12 May 2015 10:20:14 +0000 Subject: Finish work started in previous commit. Ensure that initialization code is only called once for built-in variants of the module. --- sys/dev/sysmon/swwdog.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'sys/dev') 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 -__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); -- cgit