i40e: fix led blink toggle to enable steady state
authorMatt Jared <matthew.a.jared@intel.com>
Sat, 24 Jan 2015 09:58:28 +0000 (09:58 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 9 Feb 2015 08:33:33 +0000 (00:33 -0800)
Make sure to clear the GPIO blink field, instead of OR'ing against zero
if the field is already '1'.

Change-ID: Ie52a52abd48f6f52b20778a6b8b0c542dfc9245c
Signed-off-by: Matt Jared <matthew.a.jared@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_common.c

index 5669bfa39f146bff7f52277468fbcd77348ee011..11a9ffebf8d88acdfd5b738baab62bd2b34aa30a 100644 (file)
@@ -1142,8 +1142,10 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink)
                if (mode == I40E_LINK_ACTIVITY)
                        blink = false;
 
-               gpio_val |= (blink ? 1 : 0) <<
-                           I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT;
+               if (blink)
+                       gpio_val |= (1 << I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT);
+               else
+                       gpio_val &= ~(1 << I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT);
 
                wr32(hw, I40E_GLGEN_GPIO_CTL(i), gpio_val);
                break;