wlcore: reorder identify_chip and get_hw_info
authorLuciano Coelho <coelho@ti.com>
Thu, 10 May 2012 09:14:02 +0000 (12:14 +0300)
committerLuciano Coelho <coelho@ti.com>
Tue, 5 Jun 2012 12:57:41 +0000 (15:57 +0300)
We can do get the HW information and identify the chip already at
probe time.  This makes it easier to mangle with the parameters during
identify chip before registering the hardware with mac80211.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
drivers/net/wireless/ti/wlcore/main.c

index bc33ee25f7d19655f7d1d64489dfb3cd9b080346..2e77f731c0a104a642d72c577af329c481746768 100644 (file)
@@ -962,10 +962,6 @@ static int wl12xx_chip_wakeup(struct wl1271 *wl, bool plt)
        if (wl1271_set_block_size(wl))
                wl->quirks |= WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN;
 
-       ret = wl->ops->identify_chip(wl);
-       if (ret < 0)
-               goto out;
-
        /* TODO: make sure the lower driver has set things up correctly */
 
        ret = wl1271_setup(wl);
@@ -4872,12 +4868,6 @@ static int wl1271_register_hw(struct wl1271 *wl)
        if (wl->mac80211_registered)
                return 0;
 
-       ret = wl12xx_get_hw_info(wl);
-       if (ret < 0) {
-               wl1271_error("couldn't get hw info");
-               goto out;
-       }
-
        ret = wl1271_fetch_nvs(wl);
        if (ret == 0) {
                /* NOTE: The wl->nvs->nvs element must be first, in
@@ -5282,6 +5272,16 @@ int __devinit wlcore_probe(struct wl1271 *wl, struct platform_device *pdev)
        }
        disable_irq(wl->irq);
 
+       ret = wl12xx_get_hw_info(wl);
+       if (ret < 0) {
+               wl1271_error("couldn't get hw info");
+               goto out;
+       }
+
+       ret = wl->ops->identify_chip(wl);
+       if (ret < 0)
+               goto out;
+
        ret = wl1271_init_ieee80211(wl);
        if (ret)
                goto out_irq;