summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2016-01-07 11:13:35 +0100
committerBjørn Mork <bjorn@mork.no>2016-01-07 11:13:35 +0100
commit7f24b72a03e22452320deb6316838af2b28f6c9d (patch)
tree3037e9815c85150048871f24c73919c43a58fce3
parentf9cc5b8f69b31ab522e9c89ebfab984bad55eab0 (diff)
early exit if unable to read from hw20160107-2
Signed-off-by: Bjørn Mork <bjorn@mork.no>
-rw-r--r--main.c6
1 files changed, 5 insertions, 1 deletions
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);