提交 a1beec4b 编写于 作者: A Amitkumar Karwar 提交者: Kalle Valo

mwifiex: remove redundant pdev check in suspend/resume handlers

to_pci_dev() would just do struct offset arithmetic on struct
device to get 'pdev' pointer. We never get NULL pdev pointer.
Signed-off-by: NAmitkumar Karwar <akarwar@marvell.com>
Tested-by: NXinming Hu <huxm@marvell.com>
Signed-off-by: NBrian Norris <briannorris@chromium.org>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 4a79aa17
...@@ -117,14 +117,9 @@ static int mwifiex_pcie_suspend(struct device *dev) ...@@ -117,14 +117,9 @@ static int mwifiex_pcie_suspend(struct device *dev)
struct pcie_service_card *card; struct pcie_service_card *card;
struct pci_dev *pdev = to_pci_dev(dev); struct pci_dev *pdev = to_pci_dev(dev);
if (pdev) { card = pci_get_drvdata(pdev);
card = pci_get_drvdata(pdev); if (!card || !card->adapter) {
if (!card || !card->adapter) { pr_err("Card or adapter structure is not valid\n");
pr_err("Card or adapter structure is not valid\n");
return 0;
}
} else {
pr_err("PCIE device is not specified\n");
return 0; return 0;
} }
...@@ -162,14 +157,9 @@ static int mwifiex_pcie_resume(struct device *dev) ...@@ -162,14 +157,9 @@ static int mwifiex_pcie_resume(struct device *dev)
struct pcie_service_card *card; struct pcie_service_card *card;
struct pci_dev *pdev = to_pci_dev(dev); struct pci_dev *pdev = to_pci_dev(dev);
if (pdev) { card = pci_get_drvdata(pdev);
card = pci_get_drvdata(pdev); if (!card || !card->adapter) {
if (!card || !card->adapter) { dev_err(dev, "Card or adapter structure is not valid\n");
pr_err("Card or adapter structure is not valid\n");
return 0;
}
} else {
pr_err("PCIE device is not specified\n");
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册