diff options
author | chloedai <chloedai@google.com> | 2021-11-16 04:37:18 +0000 |
---|---|---|
committer | chloedai <chloedai@google.com> | 2021-11-17 01:46:39 +0000 |
commit | 08886a0ea9d89d22f911d663d55b9fff2b8a3846 (patch) | |
tree | 2da3272d86c3b61ac1ecef2a80c71efb5c9907b5 | |
parent | 5bc9122386af59f1e12798da30327077c0cb172d (diff) | |
download | nfc-08886a0ea9d89d22f911d663d55b9fff2b8a3846.tar.gz |
Remove the redundant variable
The member p_idle_last become unnecessary after the status of
pw_current and p_idle_last have been synchronized
Bug: 206060289
Test: Build pass
Change-Id: I86f5c47cc53e3a6fa4231d703e3a5a08106afee3
-rw-r--r-- | st21nfc.c | 9 |
1 files changed, 1 insertions, 8 deletions
@@ -109,7 +109,6 @@ struct st21nfc_device { enum st21nfc_power_state pw_current; enum st21nfc_read_state r_state_current; int irq_pw_stats_idle; - int p_idle_last; struct nfc_sub_power_stats pw_states[ST21NFC_POWER_STATE_MAX]; struct nfc_sub_power_stats_error pw_states_err; struct workqueue_struct *st_p_wq; @@ -1127,11 +1126,6 @@ static int st21nfc_suspend(struct device *device) st21nfc_dev->irq_wake_up = true; } - if (!IS_ERR(st21nfc_dev->gpiod_pidle)) { - st21nfc_dev->p_idle_last = - gpiod_get_value(st21nfc_dev->gpiod_pidle); - } - return 0; } @@ -1148,8 +1142,7 @@ static int st21nfc_resume(struct device *device) if (!IS_ERR(st21nfc_dev->gpiod_pidle)) { bool is_active = (bool) gpiod_get_value(st21nfc_dev->gpiod_pidle); is_active = st21nfc_dev->pidle_active_low ? !is_active : is_active; - if((st21nfc_dev->p_idle_last != is_active) || - (st21nfc_dev->pw_current == ST21NFC_IDLE && is_active) || + if((st21nfc_dev->pw_current == ST21NFC_IDLE && is_active) || (st21nfc_dev->pw_current == ST21NFC_ACTIVE && !is_active)) { queue_work(st21nfc_dev->st_p_wq, &(st21nfc_dev->st_p_work)); |