Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sysmon Don't create the driver's workqueue twice!



details:   https://anonhg.NetBSD.org/src/rev/3253afb2608b
branches:  trunk
changeset: 449878:3253afb2608b
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Wed Mar 27 09:52:16 2019 +0000

description:
Don't create the driver's workqueue twice!

The driver is modular, so its modcmd(MOULE_CMD_INIT) always gets called
whether or not the driver is built-in to the kernel.  The modcmd init
code always calls swwdogattach() which creates the workqueue.  Therefore
there's no need to also create it in swwdog_attach() (used to attach a
device instance).

diffstat:

 sys/dev/sysmon/swwdog.c |  10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diffs (38 lines):

diff -r 1ccf0a1f5f1c -r 3253afb2608b sys/dev/sysmon/swwdog.c
--- a/sys/dev/sysmon/swwdog.c   Wed Mar 27 07:29:29 2019 +0000
+++ b/sys/dev/sysmon/swwdog.c   Wed Mar 27 09:52:16 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: swwdog.c,v 1.19 2015/05/12 10:20:14 pgoyette Exp $     */
+/*     $NetBSD: swwdog.c,v 1.20 2019/03/27 09:52:16 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.19 2015/05/12 10:20:14 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: swwdog.c,v 1.20 2019/03/27 09:52:16 pgoyette Exp $");
 
 /*
  *
@@ -160,11 +160,6 @@
 {
        struct swwdog_softc *sc = device_private(self);
 
-       if (workqueue_create(&wq, "swwreboot", doreboot, NULL,
-           PRI_NONE, IPL_NONE, 0) != 0) {
-               aprint_error_dev(self, "failed to create reboot workqueue");
-       }
-
        sc->sc_dev = self;
        sc->sc_smw.smw_name = device_xname(self);
        sc->sc_smw.smw_cookie = sc;
@@ -181,7 +176,6 @@
                aprint_error_dev(self, "unable to register software "
                    "watchdog with sysmon\n");
                callout_destroy(&sc->sc_c);
-               workqueue_destroy(wq);
                return;
        }
 



Home | Main Index | Thread Index | Old Index