[PATCH 3/4] misc: rtsx: Cleanup power management ops
From: Kai-Heng Feng
Date: Thu Jan 20 2022 - 09:50:37 EST
- Use cancel_delayed_work_sync to ensure there's no race with
carddet_work.
- Remove device_wakeup_disable to save some CPU cycles. If the device
really has ACPI _DSW then the wakeup should be disabled in probe
routine.
- Remove fetch_vendor_settings from runtime resume routine, since they
are already saved in "struct rtsx_pcr".
Cc: Ricky WU <ricky_wu@xxxxxxxxxxx>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@xxxxxxxxxxxxx>
---
drivers/misc/cardreader/rtsx_pcr.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/misc/cardreader/rtsx_pcr.c b/drivers/misc/cardreader/rtsx_pcr.c
index 1dcf98b597569..8107c85028c37 100644
--- a/drivers/misc/cardreader/rtsx_pcr.c
+++ b/drivers/misc/cardreader/rtsx_pcr.c
@@ -1671,14 +1671,12 @@ static int __maybe_unused rtsx_pci_suspend(struct device *dev_d)
handle = pci_get_drvdata(pcidev);
pcr = handle->pcr;
- cancel_delayed_work(&pcr->carddet_work);
+ cancel_delayed_work_sync(&pcr->carddet_work);
mutex_lock(&pcr->pcr_mutex);
rtsx_pci_power_off(pcr, HOST_ENTER_S3);
- device_wakeup_disable(dev_d);
-
mutex_unlock(&pcr->pcr_mutex);
return 0;
}
@@ -1791,9 +1789,6 @@ static int rtsx_pci_runtime_resume(struct device *device)
rtsx_pci_write_register(pcr, HOST_SLEEP_STATE, 0x03, 0x00);
- if (pcr->ops->fetch_vendor_settings)
- pcr->ops->fetch_vendor_settings(pcr);
-
rtsx_pci_init_hw(pcr);
if (pcr->slots[RTSX_SD_CARD].p_dev != NULL) {
--
2.33.1