+@@ -1286,6 +1281,14 @@ static int ath_start_rfkill_poll(struct
+ }
+ #endif /* CONFIG_RFKILL */
+
++static void ath_cleanup(struct ath_softc *sc)
++{
++ ath_detach(sc);
++ free_irq(sc->irq, sc);
++ ath_bus_cleanup(sc);
++ ieee80211_free_hw(sc->hw);
++}
++
+ static void ath_detach(struct ath_softc *sc)
+ {
+ struct ieee80211_hw *hw = sc->hw;
+@@ -2538,8 +2541,18 @@ ath_rf_name(u16 rf_version)