From 7f24b72a03e22452320deb6316838af2b28f6c9d Mon Sep 17 00:00:00 2001 From: Bjørn Mork Date: Thu, 7 Jan 2016 11:13:35 +0100 Subject: early exit if unable to read from hw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bjørn Mork --- main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 4425ce3..1b43597 100644 --- a/main.c +++ b/main.c @@ -780,6 +780,11 @@ static int mwl_probe(struct pci_dev *pdev, const struct pci_device_id *id) SET_IEEE80211_DEV(hw, priv->dev); rc = mwl_alloc_pci_resource(priv); + + /* verify that we can communicate with the hardware */ + if (!rc && !mwl_fwcmd_chk_adapter(priv)) + rc = -ENODEV; + if (rc) goto err_alloc_pci_resource; @@ -791,7 +796,6 @@ static int mwl_probe(struct pci_dev *pdev, const struct pci_device_id *id) #endif rc = mwl_init_firmware(priv, fw_name); - if (rc) { wiphy_err(hw->wiphy, "%s: fail to initialize firmware\n", MWL_DRV_NAME); -- cgit v1.2.3