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: Amitkumar Karwar <akarwar@marvell.com> Tested-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
4a79aa17d5
commit
a1beec4b2c
|
@ -117,16 +117,11 @@ static int mwifiex_pcie_suspend(struct device *dev)
|
|||
struct pcie_service_card *card;
|
||||
struct pci_dev *pdev = to_pci_dev(dev);
|
||||
|
||||
if (pdev) {
|
||||
card = pci_get_drvdata(pdev);
|
||||
if (!card || !card->adapter) {
|
||||
pr_err("Card or adapter structure is not valid\n");
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
pr_err("PCIE device is not specified\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
adapter = card->adapter;
|
||||
mwifiex_enable_wake(adapter);
|
||||
|
@ -162,14 +157,9 @@ static int mwifiex_pcie_resume(struct device *dev)
|
|||
struct pcie_service_card *card;
|
||||
struct pci_dev *pdev = to_pci_dev(dev);
|
||||
|
||||
if (pdev) {
|
||||
card = pci_get_drvdata(pdev);
|
||||
if (!card || !card->adapter) {
|
||||
pr_err("Card or adapter structure is not valid\n");
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
pr_err("PCIE device is not specified\n");
|
||||
dev_err(dev, "Card or adapter structure is not valid\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue