summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/marvell
diff options
context:
space:
mode:
authorChuhong Yuan <hslester96@gmail.com>2019-07-24 19:27:45 +0800
committerKalle Valo <kvalo@codeaurora.org>2019-08-06 15:33:51 +0300
commitffa4d78cbc2644b4867b8129b3fbb5ddcdfcdba2 (patch)
treed8419de384c5c7bd3e9cd954fd44b357cbde285c /drivers/net/wireless/marvell
parenta40c28700d98d955f0d8fc96b5feb00b23fd8a6a (diff)
downloadlinux-stable-ffa4d78cbc2644b4867b8129b3fbb5ddcdfcdba2.tar.gz
linux-stable-ffa4d78cbc2644b4867b8129b3fbb5ddcdfcdba2.tar.bz2
linux-stable-ffa4d78cbc2644b4867b8129b3fbb5ddcdfcdba2.zip
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: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/marvell')
-rw-r--r--drivers/net/wireless/marvell/mwifiex/pcie.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
index b54f73e3d508..eff06d59e9df 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -150,10 +150,8 @@ static bool mwifiex_pcie_ok_to_access_hw(struct mwifiex_adapter *adapter)
static int mwifiex_pcie_suspend(struct device *dev)
{
struct mwifiex_adapter *adapter;
- struct pcie_service_card *card;
- struct pci_dev *pdev = to_pci_dev(dev);
+ struct pcie_service_card *card = dev_get_drvdata(dev);
- card = pci_get_drvdata(pdev);
/* Might still be loading firmware */
wait_for_completion(&card->fw_done);
@@ -195,10 +193,8 @@ static int mwifiex_pcie_suspend(struct device *dev)
static int mwifiex_pcie_resume(struct device *dev)
{
struct mwifiex_adapter *adapter;
- struct pcie_service_card *card;
- struct pci_dev *pdev = to_pci_dev(dev);
+ struct pcie_service_card *card = dev_get_drvdata(dev);
- card = pci_get_drvdata(pdev);
if (!card->adapter) {
dev_err(dev, "adapter structure is not valid\n");