ath9k: Prune ath9k_init_device
authorSujith Manoharan <c_manoha@qca.qualcomm.com>
Mon, 4 Jun 2012 10:57:08 +0000 (16:27 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 6 Jun 2012 19:20:23 +0000 (15:20 -0400)
Instead of cluttering ath9k_init_device() with 'ath_softc'
specific initialization code, use ath9k_init_softc() to
setup driver-specific work routines, timers etc.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/init.c

index dee9e092449ab3fb00455abfdc26cb17ba57a4ca..3e2283970ee3380d6ac351f03fdd01f12d163f18 100644 (file)
@@ -489,6 +489,7 @@ static void ath9k_init_misc(struct ath_softc *sc)
 
        setup_timer(&common->ani.timer, ath_ani_calibrate, (unsigned long)sc);
 
+       sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
        sc->config.txpowlimit = ATH_TXPOWER_MAX;
        memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN);
        sc->beacon.slottime = ATH9K_SLOT_TIME_9;
@@ -560,6 +561,12 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
        tasklet_init(&sc->bcon_tasklet, ath_beacon_tasklet,
                     (unsigned long)sc);
 
+       INIT_WORK(&sc->hw_reset_work, ath_reset_work);
+       INIT_WORK(&sc->hw_check_work, ath_hw_check);
+       INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
+       INIT_DELAYED_WORK(&sc->hw_pll_work, ath_hw_pll_work);
+       setup_timer(&sc->rx_poll_timer, ath_rx_poll, (unsigned long)sc);
+
        /*
         * Cache line size is used to size and align various
         * structures used to communicate with the hardware.
@@ -782,11 +789,6 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc,
                ARRAY_SIZE(ath9k_tpt_blink));
 #endif
 
-       INIT_WORK(&sc->hw_reset_work, ath_reset_work);
-       INIT_WORK(&sc->hw_check_work, ath_hw_check);
-       INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
-       INIT_DELAYED_WORK(&sc->hw_pll_work, ath_hw_pll_work);
-
        /* Register with mac80211 */
        error = ieee80211_register_hw(hw);
        if (error)
@@ -805,9 +807,6 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc,
                        goto error_world;
        }
 
-       setup_timer(&sc->rx_poll_timer, ath_rx_poll, (unsigned long)sc);
-       sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
-
        ath_init_leds(sc);
        ath_start_rfkill_poll(sc);