diff mbox series

[net-next,07/10] iwlwifi: Use dev_get_drvdata where possible

Message ID 20190724112738.13457-1-hslester96@gmail.com (mailing list archive)
State Not Applicable
Delegated to: Luca Coelho
Headers show
Series Use dev_get_drvdata where possible | expand

Commit Message

Chuhong Yuan July 24, 2019, 11:27 a.m. UTC
Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Comments

Luca Coelho Aug. 23, 2019, 5:09 a.m. UTC | #1
On Wed, 2019-07-24 at 19:27 +0800, Chuhong Yuan wrote:
> Instead of using to_pci_dev + pci_get_drvdata,
> use dev_get_drvdata to make code simpler.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---

This patch is not relevant anymore because we have removed all
D0i3/runtime PM code.

Thanks anyway!

--
Cheers,
Luca.
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index ea2a03d4bf55..fe76e1540d39 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -1248,8 +1248,7 @@  int iwl_pci_fw_exit_d0i3(struct iwl_trans *trans)
 #ifdef CONFIG_IWLWIFI_PCIE_RTPM
 static int iwl_pci_runtime_suspend(struct device *device)
 {
-	struct pci_dev *pdev = to_pci_dev(device);
-	struct iwl_trans *trans = pci_get_drvdata(pdev);
+	struct iwl_trans *trans = dev_get_drvdata(device);
 	int ret;
 
 	IWL_DEBUG_RPM(trans, "entering runtime suspend\n");
@@ -1269,8 +1268,7 @@  static int iwl_pci_runtime_suspend(struct device *device)
 
 static int iwl_pci_runtime_resume(struct device *device)
 {
-	struct pci_dev *pdev = to_pci_dev(device);
-	struct iwl_trans *trans = pci_get_drvdata(pdev);
+	struct iwl_trans *trans = dev_get_drvdata(device);
 	enum iwl_d3_status d3_status;
 
 	IWL_DEBUG_RPM(trans, "exiting runtime suspend (resume)\n");
@@ -1285,8 +1283,7 @@  static int iwl_pci_runtime_resume(struct device *device)
 
 static int iwl_pci_system_prepare(struct device *device)
 {
-	struct pci_dev *pdev = to_pci_dev(device);
-	struct iwl_trans *trans = pci_get_drvdata(pdev);
+	struct iwl_trans *trans = dev_get_drvdata(device);
 
 	IWL_DEBUG_RPM(trans, "preparing for system suspend\n");
 
@@ -1308,8 +1305,7 @@  static int iwl_pci_system_prepare(struct device *device)
 
 static void iwl_pci_system_complete(struct device *device)
 {
-	struct pci_dev *pdev = to_pci_dev(device);
-	struct iwl_trans *trans = pci_get_drvdata(pdev);
+	struct iwl_trans *trans = dev_get_drvdata(device);
 
 	IWL_DEBUG_RPM(trans, "completing system suspend\n");