rtlwifi: rtl_pci: Use dev_get_drvdata
authorChuhong Yuan <hslester96@gmail.com>
Wed, 24 Jul 2019 11:28:02 +0000 (19:28 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 6 Aug 2019 12:33:53 +0000 (15:33 +0300)
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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtlwifi/pci.c

index 4055e0a..7d96fe5 100644 (file)
@@ -2409,8 +2409,7 @@ EXPORT_SYMBOL(rtl_pci_disconnect);
  ****************************************/
 int rtl_pci_suspend(struct device *dev)
 {
-       struct pci_dev *pdev = to_pci_dev(dev);
-       struct ieee80211_hw *hw = pci_get_drvdata(pdev);
+       struct ieee80211_hw *hw = dev_get_drvdata(dev);
        struct rtl_priv *rtlpriv = rtl_priv(hw);
 
        rtlpriv->cfg->ops->hw_suspend(hw);
@@ -2422,8 +2421,7 @@ EXPORT_SYMBOL(rtl_pci_suspend);
 
 int rtl_pci_resume(struct device *dev)
 {
-       struct pci_dev *pdev = to_pci_dev(dev);
-       struct ieee80211_hw *hw = pci_get_drvdata(pdev);
+       struct ieee80211_hw *hw = dev_get_drvdata(dev);
        struct rtl_priv *rtlpriv = rtl_priv(hw);
 
        rtlpriv->cfg->ops->hw_resume(hw);