Skip to content

Commit 77dce3a

Browse files
committed
leds: disallow /sys/class/leds/*:multi:* for now
All the LEDs in the queue are RGB, so they should not use multi for their color. Make sure we don't add such LED by mistake (and make it part of ABI). Signed-off-by: Pavel Machek <[email protected]>
1 parent 54212f5 commit 77dce3a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/leds/led-core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,10 @@ int led_compose_name(struct device *dev, struct led_init_data *init_data,
425425
struct fwnode_handle *fwnode = init_data->fwnode;
426426
const char *devicename = init_data->devicename;
427427

428+
/* We want to label LEDs that can produce full range of colors
429+
* as RGB, not multicolor */
430+
BUG_ON(props.color == LED_COLOR_ID_MULTI);
431+
428432
if (!led_classdev_name)
429433
return -EINVAL;
430434

0 commit comments

Comments
 (0)