Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

leds: qnap-mcu: Fix state numbering for USB LED

The "@Cx" commands span a number of different functions, from the status
and USB LEDs to the buzzer and power button.

So change the USB-LED enum to start at 0 and adapt the offset accordingly
to not suggest @CD would relate to the USB-LED - while in fact "@CD" is a
state of the status LED.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20250804114949.3127417-2-heiko@sntech.de
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Heiko Stuebner and committed by
Lee Jones
fe4ffdba 7d5c3cac

+5 -5
+5 -5
drivers/leds/leds-qnap-mcu.c
··· 104 104 } 105 105 106 106 enum qnap_mcu_usb_led_mode { 107 - QNAP_MCU_USB_LED_ON = 1, 108 - QNAP_MCU_USB_LED_OFF = 3, 109 - QNAP_MCU_USB_LED_BLINK = 2, 107 + QNAP_MCU_USB_LED_ON = 0, 108 + QNAP_MCU_USB_LED_OFF = 2, 109 + QNAP_MCU_USB_LED_BLINK = 1, 110 110 }; 111 111 112 112 struct qnap_mcu_usb_led { ··· 137 137 * Byte 3 is shared between the usb led target on/off/blink 138 138 * and also the buzzer control (in the input driver) 139 139 */ 140 - cmd[2] = 'D' + usb_led->mode; 140 + cmd[2] = 'E' + usb_led->mode; 141 141 142 142 return qnap_mcu_exec_with_ack(usb_led->mcu, cmd, sizeof(cmd)); 143 143 } ··· 161 161 * Byte 3 is shared between the USB LED target on/off/blink 162 162 * and also the buzzer control (in the input driver) 163 163 */ 164 - cmd[2] = 'D' + usb_led->mode; 164 + cmd[2] = 'E' + usb_led->mode; 165 165 166 166 return qnap_mcu_exec_with_ack(usb_led->mcu, cmd, sizeof(cmd)); 167 167 }