]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/blobdiff - drivers/staging/rtl8187se/r8180_core.c
Staging: r8187se: Fix for LED not following radio switch
[lisovros/linux_canprio.git] / drivers / staging / rtl8187se / r8180_core.c
index ac987d1492195379f7bade492b6a0f871ccc1ca2..0b7ec6b949b4332447e34d27f69cb0761e4b6c3b 100644 (file)
@@ -4238,11 +4238,12 @@ void GPIOChangeRFWorkItemCallBack(struct work_struct *work)
        /* HW radio On/Off according to the value of FF51[4](config0) */
        btConfig0 = btPSR = read_nic_byte(dev, CONFIG0);
 
-       /* Turn on LED. */
-       write_nic_byte(dev, PSR, btPSR | BIT3);
-
        eRfPowerStateToSet = (btConfig0 & BIT4) ?  eRfOn : eRfOff;
 
+       /* Turn LED back on when radio enabled */
+       if (eRfPowerStateToSet == eRfOn)
+               write_nic_byte(dev, PSR, btPSR | BIT3);
+
        if ((priv->ieee80211->bHwRadioOff == true) &&
           (eRfPowerStateToSet == eRfOn)) {
                priv->ieee80211->bHwRadioOff = false;