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

Staging: bcm: led_control.c: Replaced member accessing by variable

Signed-off-by: default avatarMatthias Beyer <mail@beyermatthias.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a143aa2a
...@@ -488,6 +488,7 @@ static int ReadConfigFileStructure(struct bcm_mini_adapter *Adapter, ...@@ -488,6 +488,7 @@ static int ReadConfigFileStructure(struct bcm_mini_adapter *Adapter,
UINT uiNum_of_LED_Type = 0; UINT uiNum_of_LED_Type = 0;
PUCHAR puCFGData = NULL; PUCHAR puCFGData = NULL;
UCHAR bData = 0; UCHAR bData = 0;
struct bcm_led_state_info *curr_led_state;
memset(GPIO_Array, DISABLE_GPIO_NUM, NUM_OF_LEDS+1); memset(GPIO_Array, DISABLE_GPIO_NUM, NUM_OF_LEDS+1);
if (!Adapter->pstargetparams || IS_ERR(Adapter->pstargetparams)) { if (!Adapter->pstargetparams || IS_ERR(Adapter->pstargetparams)) {
...@@ -523,31 +524,30 @@ static int ReadConfigFileStructure(struct bcm_mini_adapter *Adapter, ...@@ -523,31 +524,30 @@ static int ReadConfigFileStructure(struct bcm_mini_adapter *Adapter,
for (uiIndex = 0; uiIndex < NUM_OF_LEDS; uiIndex++) { for (uiIndex = 0; uiIndex < NUM_OF_LEDS; uiIndex++) {
bData = *puCFGData; bData = *puCFGData;
curr_led_state = &Adapter->LEDInfo.LEDState[uiIndex];
/* /*
* Check Bit 8 for polarity. If it is set, * Check Bit 8 for polarity. If it is set,
* polarity is reverse polarity * polarity is reverse polarity
*/ */
if (bData & 0x80) { if (bData & 0x80) {
Adapter->LEDInfo.LEDState[uiIndex].BitPolarity = 0; curr_led_state->BitPolarity = 0;
/* unset the bit 8 */ /* unset the bit 8 */
bData = bData & 0x7f; bData = bData & 0x7f;
} }
Adapter->LEDInfo.LEDState[uiIndex].LED_Type = bData; curr_led_state->LED_Type = bData;
if (bData <= NUM_OF_LEDS) if (bData <= NUM_OF_LEDS)
Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num = curr_led_state->GPIO_Num = GPIO_Array[bData];
GPIO_Array[bData];
else else
Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num = curr_led_state->GPIO_Num = DISABLE_GPIO_NUM;
DISABLE_GPIO_NUM;
puCFGData++; puCFGData++;
bData = *puCFGData; bData = *puCFGData;
Adapter->LEDInfo.LEDState[uiIndex].LED_On_State = bData; curr_led_state->LED_On_State = bData;
puCFGData++; puCFGData++;
bData = *puCFGData; bData = *puCFGData;
Adapter->LEDInfo.LEDState[uiIndex].LED_Blink_State = bData; curr_led_state->LED_Blink_State = bData;
puCFGData++; puCFGData++;
} }
...@@ -556,10 +556,11 @@ static int ReadConfigFileStructure(struct bcm_mini_adapter *Adapter, ...@@ -556,10 +556,11 @@ static int ReadConfigFileStructure(struct bcm_mini_adapter *Adapter,
* dont launch the LED control thread. * dont launch the LED control thread.
*/ */
for (uiIndex = 0; uiIndex < NUM_OF_LEDS; uiIndex++) { for (uiIndex = 0; uiIndex < NUM_OF_LEDS; uiIndex++) {
if ((Adapter->LEDInfo.LEDState[uiIndex].LED_Type == curr_led_state = &Adapter->LEDInfo.LEDState[uiIndex];
DISABLE_GPIO_NUM) ||
(Adapter->LEDInfo.LEDState[uiIndex].LED_Type == 0x7f) || if ((curr_led_state->LED_Type == DISABLE_GPIO_NUM) ||
(Adapter->LEDInfo.LEDState[uiIndex].LED_Type == 0)) (curr_led_state->LED_Type == 0x7f) ||
(curr_led_state->LED_Type == 0))
uiNum_of_LED_Type++; uiNum_of_LED_Type++;
} }
if (uiNum_of_LED_Type >= NUM_OF_LEDS) if (uiNum_of_LED_Type >= NUM_OF_LEDS)
......
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