Destroy the callout via sysmon_envsys_destroy() now that it's
initialized in sysmon_envsys_create().
This commit is contained in:
parent
16f978c748
commit
b5abdb42f6
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: sysmon_envsys.c,v 1.79 2008/01/02 12:20:26 xtraeme Exp $ */
|
/* $NetBSD: sysmon_envsys.c,v 1.80 2008/02/02 02:02:37 xtraeme Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2007 Juan Romero Pardines.
|
* Copyright (c) 2007 Juan Romero Pardines.
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.79 2008/01/02 12:20:26 xtraeme Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.80 2008/02/02 02:02:37 xtraeme Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -528,8 +528,8 @@ sysmon_envsys_create(void)
|
||||||
/*
|
/*
|
||||||
* sysmon_envsys_destroy:
|
* sysmon_envsys_destroy:
|
||||||
*
|
*
|
||||||
* + Removes all sensors from the tail queue and frees the
|
* + Removes all sensors from the tail queue, destroys the callout
|
||||||
* sysmon_envsys object.
|
* and frees the sysmon_envsys object.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
sysmon_envsys_destroy(struct sysmon_envsys *sme)
|
sysmon_envsys_destroy(struct sysmon_envsys *sme)
|
||||||
|
@ -542,7 +542,7 @@ sysmon_envsys_destroy(struct sysmon_envsys *sme)
|
||||||
edata = TAILQ_FIRST(&sme->sme_sensors_list);
|
edata = TAILQ_FIRST(&sme->sme_sensors_list);
|
||||||
TAILQ_REMOVE(&sme->sme_sensors_list, edata, sensors_head);
|
TAILQ_REMOVE(&sme->sme_sensors_list, edata, sensors_head);
|
||||||
}
|
}
|
||||||
|
callout_destroy(&sme->sme_callout);
|
||||||
kmem_free(sme, sizeof(*sme));
|
kmem_free(sme, sizeof(*sme));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: sysmon_envsys_events.c,v 1.47 2008/01/02 12:20:26 xtraeme Exp $ */
|
/* $NetBSD: sysmon_envsys_events.c,v 1.48 2008/02/02 02:02:38 xtraeme Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2007 Juan Romero Pardines.
|
* Copyright (c) 2007 Juan Romero Pardines.
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.47 2008/01/02 12:20:26 xtraeme Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.48 2008/02/02 02:02:38 xtraeme Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -382,8 +382,9 @@ out:
|
||||||
/*
|
/*
|
||||||
* sme_events_destroy:
|
* sme_events_destroy:
|
||||||
*
|
*
|
||||||
* + Destroys the events framework for this device: the workqueue and the
|
* + Destroys the events framework for this device: the callout
|
||||||
* callout are stopped/destroyed because the queue is empty.
|
* is stopped and its workqueue is destroyed because the queue
|
||||||
|
* is empty.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
sme_events_destroy(struct sysmon_envsys *sme)
|
sme_events_destroy(struct sysmon_envsys *sme)
|
||||||
|
@ -394,7 +395,6 @@ sme_events_destroy(struct sysmon_envsys *sme)
|
||||||
sme->sme_flags &= ~SME_CALLOUT_INITIALIZED;
|
sme->sme_flags &= ~SME_CALLOUT_INITIALIZED;
|
||||||
DPRINTF(("%s: events framework destroyed for '%s'\n",
|
DPRINTF(("%s: events framework destroyed for '%s'\n",
|
||||||
__func__, sme->sme_name));
|
__func__, sme->sme_name));
|
||||||
callout_destroy(&sme->sme_callout);
|
|
||||||
workqueue_destroy(sme->sme_wq);
|
workqueue_destroy(sme->sme_wq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue