Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Remove unnecessary (due SME_DISABLE_REFRESH) lo...



details:   https://anonhg.NetBSD.org/src/rev/88e6d095276b
branches:  trunk
changeset: 765717:88e6d095276b
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Fri Jun 03 18:40:41 2011 +0000

description:
Remove unnecessary (due SME_DISABLE_REFRESH) locking.

diffstat:

 sys/dev/acpi/acpi_acad.c |  16 +++-------------
 1 files changed, 3 insertions(+), 13 deletions(-)

diffs (83 lines):

diff -r 1669498e21de -r 88e6d095276b sys/dev/acpi/acpi_acad.c
--- a/sys/dev/acpi/acpi_acad.c  Fri Jun 03 17:58:18 2011 +0000
+++ b/sys/dev/acpi/acpi_acad.c  Fri Jun 03 18:40:41 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_acad.c,v 1.49 2011/02/16 08:35:51 jruoho Exp $    */
+/*     $NetBSD: acpi_acad.c,v 1.50 2011/06/03 18:40:41 jruoho Exp $    */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,12 +40,11 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_acad.c,v 1.49 2011/02/16 08:35:51 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_acad.c,v 1.50 2011/06/03 18:40:41 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
 #include <sys/module.h>
-#include <sys/mutex.h>
 #include <sys/systm.h>
 
 #include <dev/acpi/acpireg.h>
@@ -62,7 +61,6 @@
        struct sysmon_envsys    *sc_sme;
        struct sysmon_pswitch    sc_smpsw;
        envsys_data_t            sc_sensor;
-       kmutex_t                 sc_mutex;
        int                      sc_status;
 };
 
@@ -117,7 +115,6 @@
        sc->sc_node = aa->aa_node;
 
        acpiacad_init_envsys(self);
-       mutex_init(&sc->sc_mutex, MUTEX_DEFAULT, IPL_NONE);
 
        sc->sc_smpsw.smpsw_name = device_xname(self);
        sc->sc_smpsw.smpsw_type = PSWITCH_TYPE_ACADAPTER;
@@ -139,8 +136,6 @@
 
        acpi_deregister_notify(sc->sc_node);
 
-       mutex_destroy(&sc->sc_mutex);
-
        if (sc->sc_sme != NULL)
                sysmon_envsys_unregister(sc->sc_sme);
 
@@ -177,8 +172,6 @@
        ACPI_INTEGER status;
        ACPI_STATUS rv;
 
-       mutex_enter(&sc->sc_mutex);
-
        rv = acpi_eval_integer(sc->sc_node->ad_handle, "_PSR", &status);
 
        if (ACPI_FAILURE(rv))
@@ -208,8 +201,6 @@
        sc->sc_sensor.state = ENVSYS_SVALID;
        sc->sc_sensor.value_cur = sc->sc_status;
 
-       mutex_exit(&sc->sc_mutex);
-
        return;
 
 fail:
@@ -218,8 +209,6 @@
 
        aprint_debug_dev(dv, "failed to evaluate _PSR: %s\n",
            AcpiFormatException(rv));
-
-       mutex_exit(&sc->sc_mutex);
 }
 
 /*
@@ -291,6 +280,7 @@
 
 fail:
        aprint_error_dev(dv, "failed to initialize sysmon\n");
+
        sysmon_envsys_destroy(sc->sc_sme);
        sc->sc_sme = NULL;
 }



Home | Main Index | Thread Index | Old Index