ACPI: EC: Block queries until EC is fully initialized
authorAlexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Wed, 7 Mar 2007 19:28:00 +0000 (22:28 +0300)
committerLen Brown <len.brown@intel.com>
Sat, 10 Mar 2007 04:27:29 +0000 (23:27 -0500)
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/ec.c

index 2a172299b24c8b9b6be48eb27fa115517fa44776..e08cf98f504f12583174d23468a60bf4f9a28c14 100644 (file)
@@ -599,7 +599,7 @@ static struct acpi_ec *make_acpi_ec(void)
        if (!ec)
                return NULL;
 
-       atomic_set(&ec->query_pending, 0);
+       atomic_set(&ec->query_pending, 1);
        atomic_set(&ec->event_count, 1);
        mutex_init(&ec->lock);
        init_waitqueue_head(&ec->wait);
@@ -715,6 +715,9 @@ static int ec_install_handlers(struct acpi_ec *ec)
                return -ENODEV;
        }
 
+       /* EC is fully operational, allow queries */
+       atomic_set(&ec->query_pending, 0);
+
        return 0;
 }