Re: [RFC 2/3] staging: rtl8712: Change _LED_STATE enum in rtl871x driver to avoid conflicts with LED namespace
On 09/14/2016 04:55 PM, Zach Brown wrote: Adding led support for phy causes namespace conflicts for some phy drivers. The rtl871 driver declared an enum for representing LED states. The enum contains constant LED_OFF which conflicted with declartation found in linux/leds.h. LED_OFF changed to LED_STATE_OFF Signed-off-by: Zach BrownI have no objection to this change. My only substantive comment is that LED_ON should also be changed to LED_STATE_ON, otherwise there might be another namespace collision later. There is also a typo in the commit message. In addition, staging driver patches should be sent to Greg KH. Larry --- drivers/staging/rtl8712/rtl8712_led.c | 192 +- 1 file changed, 96 insertions(+), 96 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_led.c b/drivers/staging/rtl8712/rtl8712_led.c index 9055827..d53ad76 100644 --- a/drivers/staging/rtl8712/rtl8712_led.c +++ b/drivers/staging/rtl8712/rtl8712_led.c @@ -52,7 +52,7 @@ enum _LED_STATE_871x { LED_UNKNOWN = 0, LED_ON = 1, - LED_OFF = 2, + LED_STATE_OFF = 2, LED_BLINK_NORMAL = 3, LED_BLINK_SLOWLY = 4, LED_POWER_ON_BLINK = 5, @@ -92,7 +92,7 @@ static void InitLed871x(struct _adapter *padapter, struct LED_871x *pLed, nic = padapter->pnetdev; pLed->padapter = padapter; pLed->LedPin = LedPin; - pLed->CurrLedState = LED_OFF; + pLed->CurrLedState = LED_STATE_OFF; pLed->bLedOn = false; pLed->bLedBlinkInProgress = false; pLed->BlinkTimes = 0; @@ -249,7 +249,7 @@ static void SwLedBlink(struct LED_871x *pLed) } else { /* Assign LED state to toggle. */ if (pLed->BlinkingLedState == LED_ON) - pLed->BlinkingLedState = LED_OFF; + pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_ON; @@ -312,7 +312,7 @@ static void SwLedBlink1(struct LED_871x *pLed) switch (pLed->CurrLedState) { case LED_BLINK_SLOWLY: if (pLed->bLedOn) - pLed->BlinkingLedState = LED_OFF; + pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_ON; mod_timer(>BlinkTimer, jiffies + @@ -320,7 +320,7 @@ static void SwLedBlink1(struct LED_871x *pLed) break; case LED_BLINK_NORMAL: if (pLed->bLedOn) - pLed->BlinkingLedState = LED_OFF; + pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_ON; mod_timer(>BlinkTimer, jiffies + @@ -335,7 +335,7 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->bLedLinkBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_NORMAL; if (pLed->bLedOn) - pLed->BlinkingLedState = LED_OFF; + pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_ON; mod_timer(>BlinkTimer, jiffies + @@ -344,7 +344,7 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->bLedNoLinkBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_SLOWLY; if (pLed->bLedOn) - pLed->BlinkingLedState = LED_OFF; + pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_ON; mod_timer(>BlinkTimer, jiffies + @@ -353,7 +353,7 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->bLedScanBlinkInProgress = false; } else { if (pLed->bLedOn) - pLed->BlinkingLedState = LED_OFF; + pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_ON; mod_timer(>BlinkTimer, jiffies + @@ -369,7 +369,7 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->bLedLinkBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_NORMAL; if (pLed->bLedOn) - pLed->BlinkingLedState = LED_OFF; + pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState =
[RFC 2/3] staging: rtl8712: Change _LED_STATE enum in rtl871x driver to avoid conflicts with LED namespace
Adding led support for phy causes namespace conflicts for some phy drivers. The rtl871 driver declared an enum for representing LED states. The enum contains constant LED_OFF which conflicted with declartation found in linux/leds.h. LED_OFF changed to LED_STATE_OFF Signed-off-by: Zach Brown--- drivers/staging/rtl8712/rtl8712_led.c | 192 +- 1 file changed, 96 insertions(+), 96 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_led.c b/drivers/staging/rtl8712/rtl8712_led.c index 9055827..d53ad76 100644 --- a/drivers/staging/rtl8712/rtl8712_led.c +++ b/drivers/staging/rtl8712/rtl8712_led.c @@ -52,7 +52,7 @@ enum _LED_STATE_871x { LED_UNKNOWN = 0, LED_ON = 1, - LED_OFF = 2, + LED_STATE_OFF = 2, LED_BLINK_NORMAL = 3, LED_BLINK_SLOWLY = 4, LED_POWER_ON_BLINK = 5, @@ -92,7 +92,7 @@ static void InitLed871x(struct _adapter *padapter, struct LED_871x *pLed, nic = padapter->pnetdev; pLed->padapter = padapter; pLed->LedPin = LedPin; - pLed->CurrLedState = LED_OFF; + pLed->CurrLedState = LED_STATE_OFF; pLed->bLedOn = false; pLed->bLedBlinkInProgress = false; pLed->BlinkTimes = 0; @@ -249,7 +249,7 @@ static void SwLedBlink(struct LED_871x *pLed) } else { /* Assign LED state to toggle. */ if (pLed->BlinkingLedState == LED_ON) - pLed->BlinkingLedState = LED_OFF; + pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_ON; @@ -312,7 +312,7 @@ static void SwLedBlink1(struct LED_871x *pLed) switch (pLed->CurrLedState) { case LED_BLINK_SLOWLY: if (pLed->bLedOn) - pLed->BlinkingLedState = LED_OFF; + pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_ON; mod_timer(>BlinkTimer, jiffies + @@ -320,7 +320,7 @@ static void SwLedBlink1(struct LED_871x *pLed) break; case LED_BLINK_NORMAL: if (pLed->bLedOn) - pLed->BlinkingLedState = LED_OFF; + pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_ON; mod_timer(>BlinkTimer, jiffies + @@ -335,7 +335,7 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->bLedLinkBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_NORMAL; if (pLed->bLedOn) - pLed->BlinkingLedState = LED_OFF; + pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_ON; mod_timer(>BlinkTimer, jiffies + @@ -344,7 +344,7 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->bLedNoLinkBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_SLOWLY; if (pLed->bLedOn) - pLed->BlinkingLedState = LED_OFF; + pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_ON; mod_timer(>BlinkTimer, jiffies + @@ -353,7 +353,7 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->bLedScanBlinkInProgress = false; } else { if (pLed->bLedOn) - pLed->BlinkingLedState = LED_OFF; + pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_ON; mod_timer(>BlinkTimer, jiffies + @@ -369,7 +369,7 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->bLedLinkBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_NORMAL; if (pLed->bLedOn) - pLed->BlinkingLedState = LED_OFF; + pLed->BlinkingLedState = LED_STATE_OFF; else pLed->BlinkingLedState = LED_ON; mod_timer(>BlinkTimer, jiffies + @@ -378,7 +378,7 @@ static void SwLedBlink1(struct LED_871x *pLed) pLed->bLedNoLinkBlinkInProgress = true; pLed->CurrLedState = LED_BLINK_SLOWLY; if (pLed->bLedOn) -