Commit e98fb11f authored by Brian Norris's avatar Brian Norris Committed by Kalle Valo

mwifiex: stop checking for NULL drvata/intfdata

These are never NULL, so stop making people think they might be.

I don't change this for SDIO because SDIO has a racy card-reset handler
that reallocates this struct. I'd rather not touch that mess right now.
Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
Tested-by: default avatarXinming Hu <huxm@marvell.com>
Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 6caf34cb
...@@ -118,10 +118,6 @@ static int mwifiex_pcie_suspend(struct device *dev) ...@@ -118,10 +118,6 @@ static int mwifiex_pcie_suspend(struct device *dev)
struct pci_dev *pdev = to_pci_dev(dev); struct pci_dev *pdev = to_pci_dev(dev);
card = pci_get_drvdata(pdev); card = pci_get_drvdata(pdev);
if (!card) {
dev_err(dev, "card structure is not valid\n");
return 0;
}
/* Might still be loading firmware */ /* Might still be loading firmware */
wait_for_completion(&card->fw_done); wait_for_completion(&card->fw_done);
...@@ -166,8 +162,9 @@ static int mwifiex_pcie_resume(struct device *dev) ...@@ -166,8 +162,9 @@ static int mwifiex_pcie_resume(struct device *dev)
struct pci_dev *pdev = to_pci_dev(dev); struct pci_dev *pdev = to_pci_dev(dev);
card = pci_get_drvdata(pdev); card = pci_get_drvdata(pdev);
if (!card || !card->adapter) {
dev_err(dev, "Card or adapter structure is not valid\n"); if (!card->adapter) {
dev_err(dev, "adapter structure is not valid\n");
return 0; return 0;
} }
...@@ -249,8 +246,6 @@ static void mwifiex_pcie_remove(struct pci_dev *pdev) ...@@ -249,8 +246,6 @@ static void mwifiex_pcie_remove(struct pci_dev *pdev)
struct mwifiex_private *priv; struct mwifiex_private *priv;
card = pci_get_drvdata(pdev); card = pci_get_drvdata(pdev);
if (!card)
return;
wait_for_completion(&card->fw_done); wait_for_completion(&card->fw_done);
...@@ -2243,7 +2238,8 @@ static irqreturn_t mwifiex_pcie_interrupt(int irq, void *context) ...@@ -2243,7 +2238,8 @@ static irqreturn_t mwifiex_pcie_interrupt(int irq, void *context)
} }
card = pci_get_drvdata(pdev); card = pci_get_drvdata(pdev);
if (!card || !card->adapter) {
if (!card->adapter) {
pr_err("info: %s: card=%p adapter=%p\n", __func__, card, pr_err("info: %s: card=%p adapter=%p\n", __func__, card,
card ? card->adapter : NULL); card ? card->adapter : NULL);
goto exit; goto exit;
......
...@@ -503,11 +503,6 @@ static int mwifiex_usb_suspend(struct usb_interface *intf, pm_message_t message) ...@@ -503,11 +503,6 @@ static int mwifiex_usb_suspend(struct usb_interface *intf, pm_message_t message)
struct usb_tx_data_port *port; struct usb_tx_data_port *port;
int i, j; int i, j;
if (!card) {
dev_err(&intf->dev, "%s: card is NULL\n", __func__);
return 0;
}
/* Might still be loading firmware */ /* Might still be loading firmware */
wait_for_completion(&card->fw_done); wait_for_completion(&card->fw_done);
...@@ -574,8 +569,9 @@ static int mwifiex_usb_resume(struct usb_interface *intf) ...@@ -574,8 +569,9 @@ static int mwifiex_usb_resume(struct usb_interface *intf)
struct mwifiex_adapter *adapter; struct mwifiex_adapter *adapter;
int i; int i;
if (!card || !card->adapter) { if (!card->adapter) {
pr_err("%s: card or card->adapter is NULL\n", __func__); dev_err(&intf->dev, "%s: card->adapter is NULL\n",
__func__);
return 0; return 0;
} }
adapter = card->adapter; adapter = card->adapter;
...@@ -617,11 +613,6 @@ static void mwifiex_usb_disconnect(struct usb_interface *intf) ...@@ -617,11 +613,6 @@ static void mwifiex_usb_disconnect(struct usb_interface *intf)
struct usb_card_rec *card = usb_get_intfdata(intf); struct usb_card_rec *card = usb_get_intfdata(intf);
struct mwifiex_adapter *adapter; struct mwifiex_adapter *adapter;
if (!card) {
dev_err(&intf->dev, "%s: card is NULL\n", __func__);
return;
}
wait_for_completion(&card->fw_done); wait_for_completion(&card->fw_done);
adapter = card->adapter; adapter = card->adapter;
......
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