Commit e4e9d83e authored by Matthias Beyer's avatar Matthias Beyer Committed by Greg Kroah-Hartman

Staging: bcm: led_control.c: Replaced member accessing

This patch replaces member accessing with a variable in
BcmGetGPIOPinInfo().
Signed-off-by: default avatarMatthias Beyer <mail@beyermatthias.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7a0304c0
...@@ -626,33 +626,31 @@ static INT BcmGetGPIOPinInfo(struct bcm_mini_adapter *Adapter, ...@@ -626,33 +626,31 @@ static INT BcmGetGPIOPinInfo(struct bcm_mini_adapter *Adapter,
enum bcm_led_events currdriverstate) enum bcm_led_events currdriverstate)
{ {
UINT uiIndex = 0; UINT uiIndex = 0;
struct bcm_led_state_info *led_state_info;
*GPIO_num_tx = DISABLE_GPIO_NUM; *GPIO_num_tx = DISABLE_GPIO_NUM;
*GPIO_num_rx = DISABLE_GPIO_NUM; *GPIO_num_rx = DISABLE_GPIO_NUM;
for (uiIndex = 0; uiIndex < NUM_OF_LEDS; uiIndex++) { for (uiIndex = 0; uiIndex < NUM_OF_LEDS; uiIndex++) {
led_state_info = &Adapter->LEDInfo.LEDState[uiIndex];
if (((currdriverstate == NORMAL_OPERATION) || if (((currdriverstate == NORMAL_OPERATION) ||
(currdriverstate == IDLEMODE_EXIT) || (currdriverstate == IDLEMODE_EXIT) ||
(currdriverstate == FW_DOWNLOAD)) && (currdriverstate == FW_DOWNLOAD)) &&
(Adapter->LEDInfo.LEDState[uiIndex].LED_Blink_State & (led_state_info->LED_Blink_State & currdriverstate)) {
currdriverstate)) { if (led_state_info->GPIO_Num != DISABLE_GPIO_NUM) {
if (Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num
!= DISABLE_GPIO_NUM) {
if (*GPIO_num_tx == DISABLE_GPIO_NUM) { if (*GPIO_num_tx == DISABLE_GPIO_NUM) {
*GPIO_num_tx = Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num; *GPIO_num_tx = led_state_info->GPIO_Num;
*uiLedTxIndex = uiIndex; *uiLedTxIndex = uiIndex;
} else { } else {
*GPIO_num_rx = Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num; *GPIO_num_rx = led_state_info->GPIO_Num;
*uiLedRxIndex = uiIndex; *uiLedRxIndex = uiIndex;
} }
} }
} else { } else {
if ((Adapter->LEDInfo.LEDState[uiIndex].LED_On_State & if ((led_state_info->LED_On_State & currdriverstate) &&
currdriverstate) && (led_state_info->GPIO_Num != DISABLE_GPIO_NUM)) {
(Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num != *GPIO_num_tx = led_state_info->GPIO_Num;
DISABLE_GPIO_NUM)) {
*GPIO_num_tx = Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num;
*uiLedTxIndex = uiIndex; *uiLedTxIndex = uiIndex;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment