]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mwifiex: stop checking for NULL drvata/intfdata
authorBrian Norris <briannorris@chromium.org>
Fri, 18 Nov 2016 14:00:33 +0000 (19:30 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Sat, 19 Nov 2016 07:18:52 +0000 (09:18 +0200)
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: Brian Norris <briannorris@chromium.org>
Tested-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/pcie.c
drivers/net/wireless/marvell/mwifiex/usb.c

index f6d28d98da8d7d2a5be3fb9bb981474a4db4129d..98299a1feca1bffaa455a3d46f7deb684e3728c4 100644 (file)
@@ -118,10 +118,6 @@ static int mwifiex_pcie_suspend(struct device *dev)
        struct pci_dev *pdev = to_pci_dev(dev);
 
        card = pci_get_drvdata(pdev);
-       if (!card) {
-               dev_err(dev, "card structure is not valid\n");
-               return 0;
-       }
 
        /* Might still be loading firmware */
        wait_for_completion(&card->fw_done);
@@ -166,8 +162,9 @@ static int mwifiex_pcie_resume(struct device *dev)
        struct pci_dev *pdev = to_pci_dev(dev);
 
        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;
        }
 
@@ -249,8 +246,6 @@ static void mwifiex_pcie_remove(struct pci_dev *pdev)
        struct mwifiex_private *priv;
 
        card = pci_get_drvdata(pdev);
-       if (!card)
-               return;
 
        wait_for_completion(&card->fw_done);
 
@@ -2243,7 +2238,8 @@ static irqreturn_t mwifiex_pcie_interrupt(int irq, void *context)
        }
 
        card = pci_get_drvdata(pdev);
-       if (!card || !card->adapter) {
+
+       if (!card->adapter) {
                pr_err("info: %s: card=%p adapter=%p\n", __func__, card,
                       card ? card->adapter : NULL);
                goto exit;
index 55e3a01ccc3020ef130e0f26eafdee696ae8b06a..c3f696a2e8522ee9107959a026c5cc0a55a03d42 100644 (file)
@@ -503,11 +503,6 @@ static int mwifiex_usb_suspend(struct usb_interface *intf, pm_message_t message)
        struct usb_tx_data_port *port;
        int i, j;
 
-       if (!card) {
-               dev_err(&intf->dev, "%s: card is NULL\n", __func__);
-               return 0;
-       }
-
        /* Might still be loading firmware */
        wait_for_completion(&card->fw_done);
 
@@ -574,8 +569,9 @@ static int mwifiex_usb_resume(struct usb_interface *intf)
        struct mwifiex_adapter *adapter;
        int i;
 
-       if (!card || !card->adapter) {
-               pr_err("%s: card or card->adapter is NULL\n", __func__);
+       if (!card->adapter) {
+               dev_err(&intf->dev, "%s: card->adapter is NULL\n",
+                       __func__);
                return 0;
        }
        adapter = card->adapter;
@@ -617,11 +613,6 @@ static void mwifiex_usb_disconnect(struct usb_interface *intf)
        struct usb_card_rec *card = usb_get_intfdata(intf);
        struct mwifiex_adapter *adapter;
 
-       if (!card) {
-               dev_err(&intf->dev, "%s: card is NULL\n", __func__);
-               return;
-       }
-
        wait_for_completion(&card->fw_done);
 
        adapter = card->adapter;