ACPI / EC: Fix query handler related issues
authorLv Zheng <lv.zheng@intel.com>
Thu, 24 Sep 2015 06:54:48 +0000 (14:54 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 25 Sep 2015 23:46:24 +0000 (01:46 +0200)
commit0700c047f66101c7d0d23e3583f1ae9c3c2dd71c
tree0527eadfd6dd06cae0c65fbb53cb5001648db3f0
parent15b94fa32a422f4b97dc34e4b7060ec83d10bee5
ACPI / EC: Fix query handler related issues

1. acpi_ec_remove_query_handlers()
This patch refines the query handler removal logic implemented in
acpi_ec_remove_query_handler(), making it to invoke new
acpi_ec_remove_query_handlers() API, and ensuring all other removal code
paths to invoke the new API to honor the reference count of the query
handlers.

2. acpi_ec_get_query_handler_by_value()
This patch also refines the query handler search logic originally
implemented in acpi_ec_query(), collecting it into
acpi_ec_get_query_handler_by_value(). And since schedule_work() can ensure
the serilization of acpi_ec_event_handler(), we needn't put the
mutex_lock() around schedule_work().

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/ec.c