Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi/wmi acpiwmi(4): Use config_detach_children.



details:   https://anonhg.NetBSD.org/src/rev/1ffd5fb2569e
branches:  trunk
changeset: 374688:1ffd5fb2569e
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed May 10 00:08:22 2023 +0000

description:
acpiwmi(4): Use config_detach_children.

diffstat:

 sys/dev/acpi/wmi/wmi_acpi.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (42 lines):

diff -r 5989a77b4833 -r 1ffd5fb2569e sys/dev/acpi/wmi/wmi_acpi.c
--- a/sys/dev/acpi/wmi/wmi_acpi.c       Wed May 10 00:08:14 2023 +0000
+++ b/sys/dev/acpi/wmi/wmi_acpi.c       Wed May 10 00:08:22 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wmi_acpi.c,v 1.20 2021/12/12 22:20:52 andvar Exp $     */
+/*     $NetBSD: wmi_acpi.c,v 1.21 2023/05/10 00:08:22 riastradh Exp $  */
 
 /*-
  * Copyright (c) 2009, 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.20 2021/12/12 22:20:52 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.21 2023/05/10 00:08:22 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -126,18 +126,19 @@ static int
 acpi_wmi_detach(device_t self, int flags)
 {
        struct acpi_wmi_softc *sc = device_private(self);
+       int error;
+
+       error = config_detach_children(self, flags);
+       if (error)
+               return error;
 
        acpi_wmi_event_del(sc);
 
        if (sc->sc_ecdev != NULL) {
-
                (void)AcpiRemoveAddressSpaceHandler(sc->sc_node->ad_handle,
                    ACPI_ADR_SPACE_EC, acpi_wmi_ec_handler);
        }
 
-       if (sc->sc_child != NULL)
-               (void)config_detach(sc->sc_child, flags);
-
        acpi_wmi_del(sc);
        pmf_device_deregister(self);
 



Home | Main Index | Thread Index | Old Index