* [PATCH 16/31] net: broadcom: changing LED_* from enum led_brightness to actual value
[not found] <20220121165436.30956-1-sampaio.ime@gmail.com>
@ 2022-01-21 16:54 ` Luiz Sampaio
2022-01-22 8:21 ` Arend van Spriel
0 siblings, 1 reply; 2+ messages in thread
From: Luiz Sampaio @ 2022-01-21 16:54 UTC (permalink / raw)
To: Kalle Valo, David S. Miller, Jakub Kicinski, Larry Finger
Cc: linux-kernel, Luiz Sampaio, linux-wireless, b43-dev, netdev
The enum led_brightness, which contains the declaration of LED_OFF,
LED_ON, LED_HALF and LED_FULL is obsolete, as the led class now supports
max_brightness.
---
drivers/net/wireless/broadcom/b43/leds.c | 2 +-
drivers/net/wireless/broadcom/b43legacy/leds.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/broadcom/b43/leds.c b/drivers/net/wireless/broadcom/b43/leds.c
index 982a772a9d87..bdb46168e019 100644
--- a/drivers/net/wireless/broadcom/b43/leds.c
+++ b/drivers/net/wireless/broadcom/b43/leds.c
@@ -59,7 +59,7 @@ static void b43_led_update(struct b43_wldev *dev,
* with the brightness_set handler, we will be called again soon
* to fixup our state. */
if (radio_enabled)
- turn_on = atomic_read(&led->state) != LED_OFF;
+ turn_on = atomic_read(&led->state) != 0;
else
turn_on = false;
if (turn_on == led->hw_state)
diff --git a/drivers/net/wireless/broadcom/b43legacy/leds.c b/drivers/net/wireless/broadcom/b43legacy/leds.c
index 38b5be3a84e2..5803d41185e7 100644
--- a/drivers/net/wireless/broadcom/b43legacy/leds.c
+++ b/drivers/net/wireless/broadcom/b43legacy/leds.c
@@ -66,7 +66,7 @@ static void b43legacy_led_brightness_set(struct led_classdev *led_dev,
* whether the LED has the wrong state for a second. */
radio_enabled = (dev->phy.radio_on && dev->radio_hw_enable);
- if (brightness == LED_OFF || !radio_enabled)
+ if (brightness == 0 || !radio_enabled)
b43legacy_led_turn_off(dev, led->index, led->activelow);
else
b43legacy_led_turn_on(dev, led->index, led->activelow);
--
2.34.1
_______________________________________________
b43-dev mailing list
b43-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/b43-dev
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 16/31] net: broadcom: changing LED_* from enum led_brightness to actual value
2022-01-21 16:54 ` [PATCH 16/31] net: broadcom: changing LED_* from enum led_brightness to actual value Luiz Sampaio
@ 2022-01-22 8:21 ` Arend van Spriel
0 siblings, 0 replies; 2+ messages in thread
From: Arend van Spriel @ 2022-01-22 8:21 UTC (permalink / raw)
To: Luiz Sampaio, Kalle Valo, David S. Miller, Jakub Kicinski,
Larry Finger
Cc: linux-kernel, linux-wireless, b43-dev, netdev
[-- Attachment #1.1: Type: text/plain, Size: 867 bytes --]
On 1/21/2022 5:54 PM, Luiz Sampaio wrote:
> The enum led_brightness, which contains the declaration of LED_OFF,
> LED_ON, LED_HALF and LED_FULL is obsolete, as the led class now supports
> max_brightness.
The commit message sounds a bit obscure to me. You say the
led_brightness enumeration is or rather will become obsolete. I don't
understand the reason given "led class now supports max_brightness".
What does that mean?
Also I do not understand the approach here. If the enum is obsolete why
not start with the APIs using it like the led callbacks
brightness_{get,set{,_blocking}}. I suspect that is your next step, but
it seems like unnecessary churn to me.
Anyway, what triggered me to look at this is the fact that we do have a
led.c under drivers/net/wireless/broadcom/brcm80211/brcmsmac
implementing the brightness_set() callback.
Regards,
Arend
[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4219 bytes --]
[-- Attachment #2: Type: text/plain, Size: 149 bytes --]
_______________________________________________
b43-dev mailing list
b43-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/b43-dev
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-22 8:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220121165436.30956-1-sampaio.ime@gmail.com>
2022-01-21 16:54 ` [PATCH 16/31] net: broadcom: changing LED_* from enum led_brightness to actual value Luiz Sampaio
2022-01-22 8:21 ` Arend van Spriel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox