diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index b744f6e0bc8c..a9a1ee312f91 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -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 -__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; diff --git a/sys/dev/acpi/acpi_wakedev.c b/sys/dev/acpi/acpi_wakedev.c index d1bd360376c8..943dabb6b6ec 100644 --- a/sys/dev/acpi/acpi_wakedev.c +++ b/sys/dev/acpi/acpi_wakedev.c @@ -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 @@ -27,7 +27,7 @@ */ #include -__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 #include @@ -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; diff --git a/sys/dev/acpi/wmi/wmi_acpi.c b/sys/dev/acpi/wmi/wmi_acpi.c index 3ed37014b205..233b6e10ecf8 100644 --- a/sys/dev/acpi/wmi/wmi_acpi.c +++ b/sys/dev/acpi/wmi/wmi_acpi.c @@ -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 @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ #include -__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 #include @@ -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)); } }