Use KM_SLEEP.

This commit is contained in:
jruoho 2012-08-14 14:38:02 +00:00
parent 4f0c2c3f04
commit ce0335d479
3 changed files with 9 additions and 16 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi.c,v 1.253 2012/04/10 13:48:24 jruoho Exp $ */
/* $NetBSD: acpi.c,v 1.254 2012/08/14 14:38:02 jruoho Exp $ */
/*-
* Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@ -100,7 +100,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.253 2012/04/10 13:48:24 jruoho Exp $");
__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.254 2012/08/14 14:38:02 jruoho Exp $");
#include "opt_acpi.h"
#include "opt_pcifixup.h"
@ -708,7 +708,7 @@ acpi_make_devnode(ACPI_HANDLE handle, uint32_t level,
case ACPI_TYPE_THERMAL:
case ACPI_TYPE_POWER:
ad = kmem_zalloc(sizeof(*ad), KM_NOSLEEP);
ad = kmem_zalloc(sizeof(*ad), KM_SLEEP);
if (ad == NULL)
return AE_NO_MEMORY;

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi_wakedev.c,v 1.24 2011/02/19 09:52:32 jruoho Exp $ */
/* $NetBSD: acpi_wakedev.c,v 1.25 2012/08/14 14:38:02 jruoho Exp $ */
/*-
* Copyright (c) 2009, 2010, 2011 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi_wakedev.c,v 1.24 2011/02/19 09:52:32 jruoho Exp $");
__KERNEL_RCSID(0, "$NetBSD: acpi_wakedev.c,v 1.25 2012/08/14 14:38:02 jruoho Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -127,7 +127,7 @@ acpi_wakedev_init(struct acpi_devnode *ad)
goto out;
}
ad->ad_wakedev = kmem_zalloc(sizeof(*ad->ad_wakedev), KM_NOSLEEP);
ad->ad_wakedev = kmem_zalloc(sizeof(*ad->ad_wakedev), KM_SLEEP);
if (ad->ad_wakedev == NULL)
return;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wmi_acpi.c,v 1.13 2011/07/17 02:46:01 jakllsch Exp $ */
/* $NetBSD: wmi_acpi.c,v 1.14 2012/08/14 14:38:02 jruoho Exp $ */
/*-
* Copyright (c) 2009, 2010 Jukka Ruohonen <jruohonen@iki.fi>
@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.13 2011/07/17 02:46:01 jakllsch Exp $");
__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.14 2012/08/14 14:38:02 jruoho Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -238,7 +238,7 @@ acpi_wmi_add(struct acpi_wmi_softc *sc, ACPI_OBJECT *obj)
for (i = offset = 0; i < n; ++i) {
if ((wmi = kmem_zalloc(sizeof(*wmi), KM_NOSLEEP)) == NULL)
if ((wmi = kmem_zalloc(sizeof(*wmi), KM_SLEEP)) == NULL)
goto fail;
(void)memcpy(&wmi->guid, obj->Buffer.Pointer + offset, siz);
@ -265,16 +265,9 @@ acpi_wmi_del(struct acpi_wmi_softc *sc)
{
struct wmi_t *wmi;
if (SIMPLEQ_EMPTY(&sc->wmi_head) != 0)
return;
while (SIMPLEQ_FIRST(&sc->wmi_head) != NULL) {
wmi = SIMPLEQ_FIRST(&sc->wmi_head);
SIMPLEQ_REMOVE_HEAD(&sc->wmi_head, wmi_link);
KASSERT(wmi != NULL);
kmem_free(wmi, sizeof(*wmi));
}
}