Skip to content

Commit 98d3645

Browse files
committed
ACPI: EC: Fold acpi_ec_check_event() into acpi_ec_event_handler()
Because acpi_ec_event_handler() is the only caller of acpi_ec_check_event() and the separation of these two functions makes it harder to follow the code flow, fold the latter into the former (and simplify that code while at it). No expected functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 1f23504 commit 98d3645

1 file changed

Lines changed: 9 additions & 19 deletions

File tree

drivers/acpi/ec.c

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,24 +1215,6 @@ static int acpi_ec_query(struct acpi_ec *ec)
12151215
return result;
12161216
}
12171217

1218-
static void acpi_ec_check_event(struct acpi_ec *ec)
1219-
{
1220-
unsigned long flags;
1221-
1222-
if (ec_event_clearing == ACPI_EC_EVT_TIMING_EVENT) {
1223-
if (ec_guard(ec)) {
1224-
spin_lock_irqsave(&ec->lock, flags);
1225-
/*
1226-
* Take care of the SCI_EVT unless no one else is
1227-
* taking care of it.
1228-
*/
1229-
if (!ec->curr)
1230-
advance_transaction(ec, false);
1231-
spin_unlock_irqrestore(&ec->lock, flags);
1232-
}
1233-
}
1234-
}
1235-
12361218
static void acpi_ec_event_handler(struct work_struct *work)
12371219
{
12381220
unsigned long flags;
@@ -1264,7 +1246,15 @@ static void acpi_ec_event_handler(struct work_struct *work)
12641246

12651247
ec_dbg_evt("Event stopped");
12661248

1267-
acpi_ec_check_event(ec);
1249+
if (ec_event_clearing == ACPI_EC_EVT_TIMING_EVENT && ec_guard(ec)) {
1250+
spin_lock_irqsave(&ec->lock, flags);
1251+
1252+
/* Take care of SCI_EVT unless someone else is doing that. */
1253+
if (!ec->curr)
1254+
advance_transaction(ec, false);
1255+
1256+
spin_unlock_irqrestore(&ec->lock, flags);
1257+
}
12681258

12691259
spin_lock_irqsave(&ec->lock, flags);
12701260
ec->events_in_progress--;

0 commit comments

Comments
 (0)