3131
3232/* Uncomment next line to get verbose printout */
3333/* #define DEBUG */
34- #define DEBUG_REF 0
3534#define pr_fmt (fmt ) "ACPI : EC: " fmt
3635
3736#include <linux/kernel.h>
@@ -91,13 +90,6 @@ enum {
9190#define ACPI_EC_COMMAND_POLL 0x01 /* Available for command byte */
9291#define ACPI_EC_COMMAND_COMPLETE 0x02 /* Completed last byte */
9392
94- #define ec_debug_ref (ec , fmt , ...) \
95- do { \
96- if (DEBUG_REF) \
97- pr_debug("%lu: " fmt, ec->reference_count, \
98- ## __VA_ARGS__); \
99- } while (0)
100-
10193/* ec.c is compiled in acpi namespace so this shows up as acpi.ec_delay param */
10294static unsigned int ec_delay __read_mostly = ACPI_EC_DELAY ;
10395module_param (ec_delay , uint , 0644 );
@@ -364,14 +356,12 @@ static void acpi_ec_submit_event(struct acpi_ec *ec)
364356 /* Hold reference for pending event */
365357 if (!acpi_ec_submit_flushable_request (ec , true))
366358 return ;
367- ec_debug_ref (ec , "Increase event\n" );
368359 if (!test_and_set_bit (EC_FLAGS_EVENT_PENDING , & ec -> flags )) {
369360 pr_debug ("***** Event query started *****\n" );
370361 schedule_work (& ec -> work );
371362 return ;
372363 }
373364 acpi_ec_complete_request (ec );
374- ec_debug_ref (ec , "Decrease event\n" );
375365}
376366
377367static void acpi_ec_complete_event (struct acpi_ec * ec )
@@ -381,7 +371,6 @@ static void acpi_ec_complete_event(struct acpi_ec *ec)
381371 pr_debug ("***** Event query stopped *****\n" );
382372 /* Unhold reference for pending event */
383373 acpi_ec_complete_request (ec );
384- ec_debug_ref (ec , "Decrease event\n" );
385374 /* Check if there is another SCI_EVT detected */
386375 acpi_ec_submit_event (ec );
387376 }
@@ -392,14 +381,12 @@ static void acpi_ec_submit_detection(struct acpi_ec *ec)
392381 /* Hold reference for query submission */
393382 if (!acpi_ec_submit_flushable_request (ec , false))
394383 return ;
395- ec_debug_ref (ec , "Increase query\n" );
396384 if (!test_and_set_bit (EC_FLAGS_EVENT_DETECTED , & ec -> flags )) {
397385 pr_debug ("***** Event detection blocked *****\n" );
398386 acpi_ec_submit_event (ec );
399387 return ;
400388 }
401389 acpi_ec_complete_request (ec );
402- ec_debug_ref (ec , "Decrease query\n" );
403390}
404391
405392static void acpi_ec_complete_detection (struct acpi_ec * ec )
@@ -409,7 +396,6 @@ static void acpi_ec_complete_detection(struct acpi_ec *ec)
409396 pr_debug ("***** Event detetion unblocked *****\n" );
410397 /* Unhold reference for query submission */
411398 acpi_ec_complete_request (ec );
412- ec_debug_ref (ec , "Decrease query\n" );
413399 }
414400}
415401
@@ -584,7 +570,6 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
584570 ret = - EINVAL ;
585571 goto unlock ;
586572 }
587- ec_debug_ref (ec , "Increase command\n" );
588573 /* following two actions should be kept atomic */
589574 ec -> curr = t ;
590575 pr_debug ("***** Command(%s) started *****\n" ,
@@ -600,7 +585,6 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
600585 ec -> curr = NULL ;
601586 /* Disable GPE for command processing (IBF=0/OBF=1) */
602587 acpi_ec_complete_request (ec );
603- ec_debug_ref (ec , "Decrease command\n" );
604588unlock :
605589 spin_unlock_irqrestore (& ec -> lock , tmp );
606590 return ret ;
@@ -762,10 +746,8 @@ static void acpi_ec_start(struct acpi_ec *ec, bool resuming)
762746 if (!test_and_set_bit (EC_FLAGS_STARTED , & ec -> flags )) {
763747 pr_debug ("+++++ Starting EC +++++\n" );
764748 /* Enable GPE for event processing (SCI_EVT=1) */
765- if (!resuming ) {
749+ if (!resuming )
766750 acpi_ec_submit_request (ec );
767- ec_debug_ref (ec , "Increase driver\n" );
768- }
769751 pr_info ("+++++ EC started +++++\n" );
770752 }
771753 spin_unlock_irqrestore (& ec -> lock , flags );
@@ -794,10 +776,8 @@ static void acpi_ec_stop(struct acpi_ec *ec, bool suspending)
794776 wait_event (ec -> wait , acpi_ec_stopped (ec ));
795777 spin_lock_irqsave (& ec -> lock , flags );
796778 /* Disable GPE for event processing (SCI_EVT=1) */
797- if (!suspending ) {
779+ if (!suspending )
798780 acpi_ec_complete_request (ec );
799- ec_debug_ref (ec , "Decrease driver\n" );
800- }
801781 clear_bit (EC_FLAGS_STARTED , & ec -> flags );
802782 clear_bit (EC_FLAGS_STOPPED , & ec -> flags );
803783 pr_info ("+++++ EC stopped +++++\n" );
0 commit comments