]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ath5k: minor rfkill cleanup
authorBob Copeland <me@bobcopeland.com>
Wed, 10 Jun 2009 03:43:11 +0000 (23:43 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 10 Jun 2009 17:28:39 +0000 (13:28 -0400)
Always enable rfkill since the ifdefs in the code is not really worth
the Kconfig option.  Also fix a few code style things, and remove the
usage of the ah_gpio[] array so we can remove it later.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath5k/Kconfig
drivers/net/wireless/ath/ath5k/Makefile
drivers/net/wireless/ath/ath5k/ath5k.h
drivers/net/wireless/ath/ath5k/base.c
drivers/net/wireless/ath/ath5k/base.h
drivers/net/wireless/ath/ath5k/rfkill.c

index 4863f4bbf7685ba0020e0c47b298db01c976a53b..509b6f94f73b94930ad95f90441e6b4002223ee9 100644 (file)
@@ -39,11 +39,3 @@ config ATH5K_DEBUG
 
          modprobe ath5k debug=0x00000400
 
-config ATH5K_RFKILL
-       bool "Atheros 5xxx rfkill support"
-       depends on ATH5K
-       default y
-       ---help---
-         Include support for enabling/disabling WiFi via rfkill switch
-         with Atheros 5xxx cards
-
index f1e281c5a21381b1219cc9124fd8f16dfcbbab05..090dc6d268a3014cde3cdd863c0fd9e75b507ae4 100644 (file)
@@ -11,6 +11,6 @@ ath5k-y                               += reset.o
 ath5k-y                                += attach.o
 ath5k-y                                += base.o
 ath5k-y                                += led.o
+ath5k-y                                += rfkill.o
 ath5k-$(CONFIG_ATH5K_DEBUG)    += debug.o
-ath5k-$(CONFIG_ATH5K_RFKILL)   += rfkill.o
 obj-$(CONFIG_ATH5K)            += ath5k.o
index 4c84e308763c49aa9ed1ebb67a7100c1daee4c9a..6358233bac99e8c7430e0946331e2ec23eb2405c 100644 (file)
@@ -1257,13 +1257,8 @@ extern int ath5k_hw_set_gpio(struct ath5k_hw *ah, u32 gpio, u32 val);
 extern void ath5k_hw_set_gpio_intr(struct ath5k_hw *ah, unsigned int gpio, u32 interrupt_level);
 
 /* rfkill Functions */
-#ifdef CONFIG_ATH5K_RFKILL
 extern void ath5k_rfkill_hw_start(struct ath5k_hw *ah);
 extern void ath5k_rfkill_hw_stop(struct ath5k_hw *ah);
-#else
-static inline void ath5k_rfkill_hw_start(struct ath5k_hw *ah) {}
-static inline void ath5k_rfkill_hw_stop(struct ath5k_hw *ah) {}
-#endif
 
 /* Misc functions */
 int ath5k_hw_set_capabilities(struct ath5k_hw *ah);
index f55675c23f2ec07de1f6d8c75e79141d9856c61c..55f7de09d134bc3341ac4da3fa78373b2a6a8cbd 100644 (file)
@@ -2530,12 +2530,9 @@ ath5k_intr(int irq, void *dev_id)
                                 */
                                ath5k_hw_update_mib_counters(ah, &sc->ll_stats);
                        }
-#ifdef CONFIG_ATH5K_RFKILL
                        if (status & AR5K_INT_GPIO)
-                       {
                                tasklet_schedule(&sc->rf_kill.toggleq);
-                       }
-#endif
+
                }
        } while (ath5k_hw_is_intr_pending(ah) && --counter > 0);
 
index 7a0ecdd9c258f6aa5901441c148385d6ff9e2823..f9b7f2f819b78d36c3d838d102b67f2af55133b0 100644 (file)
@@ -177,9 +177,7 @@ struct ath5k_softc {
        struct tasklet_struct   txtq;           /* tx intr tasklet */
        struct ath5k_led        tx_led;         /* tx led */
 
-#ifdef CONFIG_ATH5K_RFKILL
        struct ath5k_rfkill     rf_kill;
-#endif
 
        spinlock_t              block;          /* protects beacon */
        struct tasklet_struct   beacontq;       /* beacon intr tasklet */
index 492ada92db56b30f76646d1e9d61b9e0adeaee26..41a877b73fce76121d0cfce72f83b59360d3893e 100644 (file)
@@ -56,10 +56,12 @@ static inline void ath5k_rfkill_enable(struct ath5k_softc *sc)
 static inline void ath5k_rfkill_set_intr(struct ath5k_softc *sc, bool enable)
 {
        struct ath5k_hw *ah = sc->ah;
+       u32 curval;
+
        ath5k_hw_set_gpio_input(ah, sc->rf_kill.gpio);
-       ah->ah_gpio[0] = ath5k_hw_get_gpio(ah, sc->rf_kill.gpio);
+       curval = ath5k_hw_get_gpio(ah, sc->rf_kill.gpio);
        ath5k_hw_set_gpio_intr(ah, sc->rf_kill.gpio, enable ?
-                                       !!ah->ah_gpio[0] : !ah->ah_gpio[0]);
+                                       !!curval : !curval);
 }
 
 static bool
@@ -97,9 +99,8 @@ ath5k_rfkill_hw_start(struct ath5k_hw *ah)
        ath5k_rfkill_disable(sc);
 
        /* enable interrupt for rfkill switch */
-       if (AR5K_EEPROM_HDR_RFKILL(ah->ah_capabilities.cap_eeprom.ee_header)) {
+       if (AR5K_EEPROM_HDR_RFKILL(ah->ah_capabilities.cap_eeprom.ee_header))
                ath5k_rfkill_set_intr(sc, true);
-       }
 }
 
 
@@ -109,9 +110,8 @@ ath5k_rfkill_hw_stop(struct ath5k_hw *ah)
        struct ath5k_softc *sc = ah->ah_sc;
 
        /* disable interrupt for rfkill switch */
-       if (AR5K_EEPROM_HDR_RFKILL(ah->ah_capabilities.cap_eeprom.ee_header)) {
+       if (AR5K_EEPROM_HDR_RFKILL(ah->ah_capabilities.cap_eeprom.ee_header))
                ath5k_rfkill_set_intr(sc, false);
-       }
 
        tasklet_kill(&sc->rf_kill.toggleq);