Commit ffa4d78c authored by Chuhong Yuan's avatar Chuhong Yuan Committed by Kalle Valo

mwifiex: pcie: Use dev_get_drvdata

Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.
Signed-off-by: default avatarChuhong Yuan <hslester96@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent a40c2870
...@@ -150,10 +150,8 @@ static bool mwifiex_pcie_ok_to_access_hw(struct mwifiex_adapter *adapter) ...@@ -150,10 +150,8 @@ static bool mwifiex_pcie_ok_to_access_hw(struct mwifiex_adapter *adapter)
static int mwifiex_pcie_suspend(struct device *dev) static int mwifiex_pcie_suspend(struct device *dev)
{ {
struct mwifiex_adapter *adapter; struct mwifiex_adapter *adapter;
struct pcie_service_card *card; struct pcie_service_card *card = dev_get_drvdata(dev);
struct pci_dev *pdev = to_pci_dev(dev);
card = pci_get_drvdata(pdev);
/* Might still be loading firmware */ /* Might still be loading firmware */
wait_for_completion(&card->fw_done); wait_for_completion(&card->fw_done);
...@@ -195,10 +193,8 @@ static int mwifiex_pcie_suspend(struct device *dev) ...@@ -195,10 +193,8 @@ static int mwifiex_pcie_suspend(struct device *dev)
static int mwifiex_pcie_resume(struct device *dev) static int mwifiex_pcie_resume(struct device *dev)
{ {
struct mwifiex_adapter *adapter; struct mwifiex_adapter *adapter;
struct pcie_service_card *card; struct pcie_service_card *card = dev_get_drvdata(dev);
struct pci_dev *pdev = to_pci_dev(dev);
card = pci_get_drvdata(pdev);
if (!card->adapter) { if (!card->adapter) {
dev_err(dev, "adapter structure is not valid\n"); dev_err(dev, "adapter structure is not valid\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment