public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: dsa: realtek: Fix LED group port bit for non-zero LED group
@ 2026-03-11 11:12 Marek Behún
  2026-03-11 15:02 ` Andrew Lunn
  2026-03-12  2:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Marek Behún @ 2026-03-11 11:12 UTC (permalink / raw)
  To: Linus Walleij, Alvin Šipraga, Luiz Angelo Daros de Luca
  Cc: netdev, Marek Behún

The rtl8366rb_led_group_port_mask() function always returns LED port
bit in LED group 0; the switch statement returns the same thing in all
non-default cases.

This means that the driver does not currently support configuring LEDs
in non-zero LED groups.

Fix this.

Fixes: 32d617005475a71e ("net: dsa: realtek: add LED drivers for rtl8366rb")
Signed-off-by: Marek Behún <kabel@kernel.org>
---
I was just looking at the driver code ouf of curiosity and saw this.

I don't have corresponing hardware nor documentation.

But it seems to be a copy-paste mistake from early driver development that
was not fixed later, maybe because the original developer had only a board
with port LEDs in LED group 0...
---
 drivers/net/dsa/realtek/rtl8366rb-leds.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dsa/realtek/rtl8366rb-leds.c b/drivers/net/dsa/realtek/rtl8366rb-leds.c
index 99c890681ae6..509ffd3f8db5 100644
--- a/drivers/net/dsa/realtek/rtl8366rb-leds.c
+++ b/drivers/net/dsa/realtek/rtl8366rb-leds.c
@@ -12,11 +12,11 @@ static inline u32 rtl8366rb_led_group_port_mask(u8 led_group, u8 port)
 	case 0:
 		return FIELD_PREP(RTL8366RB_LED_0_X_CTRL_MASK, BIT(port));
 	case 1:
-		return FIELD_PREP(RTL8366RB_LED_0_X_CTRL_MASK, BIT(port));
+		return FIELD_PREP(RTL8366RB_LED_X_1_CTRL_MASK, BIT(port));
 	case 2:
-		return FIELD_PREP(RTL8366RB_LED_0_X_CTRL_MASK, BIT(port));
+		return FIELD_PREP(RTL8366RB_LED_2_X_CTRL_MASK, BIT(port));
 	case 3:
-		return FIELD_PREP(RTL8366RB_LED_0_X_CTRL_MASK, BIT(port));
+		return FIELD_PREP(RTL8366RB_LED_X_3_CTRL_MASK, BIT(port));
 	default:
 		return 0;
 	}
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: dsa: realtek: Fix LED group port bit for non-zero LED group
  2026-03-11 11:12 [PATCH net] net: dsa: realtek: Fix LED group port bit for non-zero LED group Marek Behún
@ 2026-03-11 15:02 ` Andrew Lunn
  2026-03-12  2:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2026-03-11 15:02 UTC (permalink / raw)
  To: Marek Behún
  Cc: Linus Walleij, Alvin Šipraga, Luiz Angelo Daros de Luca,
	netdev

On Wed, Mar 11, 2026 at 12:12:37PM +0100, Marek Behún wrote:
> The rtl8366rb_led_group_port_mask() function always returns LED port
> bit in LED group 0; the switch statement returns the same thing in all
> non-default cases.
> 
> This means that the driver does not currently support configuring LEDs
> in non-zero LED groups.
> 
> Fix this.
> 
> Fixes: 32d617005475a71e ("net: dsa: realtek: add LED drivers for rtl8366rb")
> Signed-off-by: Marek Behún <kabel@kernel.org>
> ---
> I was just looking at the driver code ouf of curiosity and saw this.
> 
> I don't have corresponing hardware nor documentation.
> 
> But it seems to be a copy-paste mistake from early driver development that
> was not fixed later, maybe because the original developer had only a board
> with port LEDs in LED group 0...

Patch looks sensible.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: dsa: realtek: Fix LED group port bit for non-zero LED group
  2026-03-11 11:12 [PATCH net] net: dsa: realtek: Fix LED group port bit for non-zero LED group Marek Behún
  2026-03-11 15:02 ` Andrew Lunn
@ 2026-03-12  2:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-12  2:10 UTC (permalink / raw)
  To: =?utf-8?q?Marek_Beh=C3=BAn_=3Ckabel=40kernel=2Eorg=3E?=
  Cc: linusw, alsi, luizluca, netdev

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 11 Mar 2026 12:12:37 +0100 you wrote:
> The rtl8366rb_led_group_port_mask() function always returns LED port
> bit in LED group 0; the switch statement returns the same thing in all
> non-default cases.
> 
> This means that the driver does not currently support configuring LEDs
> in non-zero LED groups.
> 
> [...]

Here is the summary with links:
  - [net] net: dsa: realtek: Fix LED group port bit for non-zero LED group
    https://git.kernel.org/netdev/net/c/e8f0dc024ce5

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-12  2:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-11 11:12 [PATCH net] net: dsa: realtek: Fix LED group port bit for non-zero LED group Marek Behún
2026-03-11 15:02 ` Andrew Lunn
2026-03-12  2:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox