diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-08-02 04:51:22 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-08-06 04:34:33 -0400 |
commit | 5fdda0476c28ff2097ae37f43f40557b91eb0160 (patch) | |
tree | e5591940426ed0347b9fc5f3a73eb3b1ddd165d5 /drivers/net/wireless/iwlwifi | |
parent | 1092b9bc0cdc1d8d456d2b9b1f857b06ef5523da (diff) |
iwlwifi: remove transport suspend/resume indirection
There's no reason for the transport to call itself through
indirect function pointers, inline the (little) code there
is and remove the indirection completely.
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans.h | 19 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/drv.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/trans.c | 26 |
3 files changed, 13 insertions, 50 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 523dc7ce294b..dd57a36ecb10 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
@@ -396,8 +396,6 @@ struct iwl_trans; | |||
396 | * May sleep | 396 | * May sleep |
397 | * @dbgfs_register: add the dbgfs files under this directory. Files will be | 397 | * @dbgfs_register: add the dbgfs files under this directory. Files will be |
398 | * automatically deleted. | 398 | * automatically deleted. |
399 | * @suspend: stop the device unless WoWLAN is configured | ||
400 | * @resume: resume activity of the device | ||
401 | * @write8: write a u8 to a register at offset ofs from the BAR | 399 | * @write8: write a u8 to a register at offset ofs from the BAR |
402 | * @write32: write a u32 to a register at offset ofs from the BAR | 400 | * @write32: write a u32 to a register at offset ofs from the BAR |
403 | * @read32: read a u32 register at offset ofs from the BAR | 401 | * @read32: read a u32 register at offset ofs from the BAR |
@@ -443,10 +441,7 @@ struct iwl_trans_ops { | |||
443 | 441 | ||
444 | int (*dbgfs_register)(struct iwl_trans *trans, struct dentry* dir); | 442 | int (*dbgfs_register)(struct iwl_trans *trans, struct dentry* dir); |
445 | int (*wait_tx_queue_empty)(struct iwl_trans *trans); | 443 | int (*wait_tx_queue_empty)(struct iwl_trans *trans); |
446 | #ifdef CONFIG_PM_SLEEP | 444 | |
447 | int (*suspend)(struct iwl_trans *trans); | ||
448 | int (*resume)(struct iwl_trans *trans); | ||
449 | #endif | ||
450 | void (*write8)(struct iwl_trans *trans, u32 ofs, u8 val); | 445 | void (*write8)(struct iwl_trans *trans, u32 ofs, u8 val); |
451 | void (*write32)(struct iwl_trans *trans, u32 ofs, u32 val); | 446 | void (*write32)(struct iwl_trans *trans, u32 ofs, u32 val); |
452 | u32 (*read32)(struct iwl_trans *trans, u32 ofs); | 447 | u32 (*read32)(struct iwl_trans *trans, u32 ofs); |
@@ -700,18 +695,6 @@ static inline int iwl_trans_dbgfs_register(struct iwl_trans *trans, | |||
700 | return trans->ops->dbgfs_register(trans, dir); | 695 | return trans->ops->dbgfs_register(trans, dir); |
701 | } | 696 | } |
702 | 697 | ||
703 | #ifdef CONFIG_PM_SLEEP | ||
704 | static inline int iwl_trans_suspend(struct iwl_trans *trans) | ||
705 | { | ||
706 | return trans->ops->suspend(trans); | ||
707 | } | ||
708 | |||
709 | static inline int iwl_trans_resume(struct iwl_trans *trans) | ||
710 | { | ||
711 | return trans->ops->resume(trans); | ||
712 | } | ||
713 | #endif | ||
714 | |||
715 | static inline void iwl_trans_write8(struct iwl_trans *trans, u32 ofs, u8 val) | 698 | static inline void iwl_trans_write8(struct iwl_trans *trans, u32 ofs, u8 val) |
716 | { | 699 | { |
717 | trans->ops->write8(trans, ofs, val); | 700 | trans->ops->write8(trans, ofs, val); |
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c index db6be2491d7c..9ec8dfeb4354 100644 --- a/drivers/net/wireless/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/iwlwifi/pcie/drv.c | |||
@@ -367,21 +367,19 @@ static void iwl_pci_remove(struct pci_dev *pdev) | |||
367 | 367 | ||
368 | static int iwl_pci_suspend(struct device *device) | 368 | static int iwl_pci_suspend(struct device *device) |
369 | { | 369 | { |
370 | struct pci_dev *pdev = to_pci_dev(device); | ||
371 | struct iwl_trans *iwl_trans = pci_get_drvdata(pdev); | ||
372 | |||
373 | /* Before you put code here, think about WoWLAN. You cannot check here | 370 | /* Before you put code here, think about WoWLAN. You cannot check here |
374 | * whether WoWLAN is enabled or not, and your code will run even if | 371 | * whether WoWLAN is enabled or not, and your code will run even if |
375 | * WoWLAN is enabled - don't kill the NIC, someone may need it in Sx. | 372 | * WoWLAN is enabled - don't kill the NIC, someone may need it in Sx. |
376 | */ | 373 | */ |
377 | 374 | ||
378 | return iwl_trans_suspend(iwl_trans); | 375 | return 0; |
379 | } | 376 | } |
380 | 377 | ||
381 | static int iwl_pci_resume(struct device *device) | 378 | static int iwl_pci_resume(struct device *device) |
382 | { | 379 | { |
383 | struct pci_dev *pdev = to_pci_dev(device); | 380 | struct pci_dev *pdev = to_pci_dev(device); |
384 | struct iwl_trans *iwl_trans = pci_get_drvdata(pdev); | 381 | struct iwl_trans *trans = pci_get_drvdata(pdev); |
382 | bool hw_rfkill; | ||
385 | 383 | ||
386 | /* Before you put code here, think about WoWLAN. You cannot check here | 384 | /* Before you put code here, think about WoWLAN. You cannot check here |
387 | * whether WoWLAN is enabled or not, and your code will run even if | 385 | * whether WoWLAN is enabled or not, and your code will run even if |
@@ -394,7 +392,15 @@ static int iwl_pci_resume(struct device *device) | |||
394 | */ | 392 | */ |
395 | pci_write_config_byte(pdev, PCI_CFG_RETRY_TIMEOUT, 0x00); | 393 | pci_write_config_byte(pdev, PCI_CFG_RETRY_TIMEOUT, 0x00); |
396 | 394 | ||
397 | return iwl_trans_resume(iwl_trans); | 395 | if (!trans->op_mode) |
396 | return 0; | ||
397 | |||
398 | iwl_enable_rfkill_int(trans); | ||
399 | |||
400 | hw_rfkill = iwl_is_rfkill_set(trans); | ||
401 | iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill); | ||
402 | |||
403 | return 0; | ||
398 | } | 404 | } |
399 | 405 | ||
400 | static SIMPLE_DEV_PM_OPS(iwl_dev_pm_ops, iwl_pci_suspend, iwl_pci_resume); | 406 | static SIMPLE_DEV_PM_OPS(iwl_dev_pm_ops, iwl_pci_suspend, iwl_pci_resume); |
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index 601ee5904738..d88c0c748274 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c | |||
@@ -815,28 +815,6 @@ static void iwl_trans_pcie_set_pmi(struct iwl_trans *trans, bool state) | |||
815 | clear_bit(STATUS_TPOWER_PMI, &trans_pcie->status); | 815 | clear_bit(STATUS_TPOWER_PMI, &trans_pcie->status); |
816 | } | 816 | } |
817 | 817 | ||
818 | #ifdef CONFIG_PM_SLEEP | ||
819 | static int iwl_trans_pcie_suspend(struct iwl_trans *trans) | ||
820 | { | ||
821 | return 0; | ||
822 | } | ||
823 | |||
824 | static int iwl_trans_pcie_resume(struct iwl_trans *trans) | ||
825 | { | ||
826 | bool hw_rfkill; | ||
827 | |||
828 | if (!trans->op_mode) | ||
829 | return 0; | ||
830 | |||
831 | iwl_enable_rfkill_int(trans); | ||
832 | |||
833 | hw_rfkill = iwl_is_rfkill_set(trans); | ||
834 | iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill); | ||
835 | |||
836 | return 0; | ||
837 | } | ||
838 | #endif /* CONFIG_PM_SLEEP */ | ||
839 | |||
840 | static bool iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans, bool silent, | 818 | static bool iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans, bool silent, |
841 | unsigned long *flags) | 819 | unsigned long *flags) |
842 | { | 820 | { |
@@ -1378,10 +1356,6 @@ static const struct iwl_trans_ops trans_ops_pcie = { | |||
1378 | 1356 | ||
1379 | .wait_tx_queue_empty = iwl_trans_pcie_wait_txq_empty, | 1357 | .wait_tx_queue_empty = iwl_trans_pcie_wait_txq_empty, |
1380 | 1358 | ||
1381 | #ifdef CONFIG_PM_SLEEP | ||
1382 | .suspend = iwl_trans_pcie_suspend, | ||
1383 | .resume = iwl_trans_pcie_resume, | ||
1384 | #endif | ||
1385 | .write8 = iwl_trans_pcie_write8, | 1359 | .write8 = iwl_trans_pcie_write8, |
1386 | .write32 = iwl_trans_pcie_write32, | 1360 | .write32 = iwl_trans_pcie_write32, |
1387 | .read32 = iwl_trans_pcie_read32, | 1361 | .read32 = iwl_trans_pcie_read32, |