Skip to content

Commit 8f2244c

Browse files
tiwailag-linaro
authored andcommitted
leds: class: Don't expose color sysfs entry
The commit c7d8005 ("leds: class: Store the color index in struct led_classdev") introduced a new sysfs entry "color" that is commonly created for the led classdev. Unfortunately, this conflicts with the "color" sysfs entry of already existing drivers such as Logitech HID or System76 ACPI drivers. The driver probe fails due to the conflict, hence it leads to a severe regression with the missing keyboard, for example. This patch reverts partially the change in the commit above for removing the led class color sysfs entries again for addressing the regressions. The newly introduced led_classdev.color field is kept as it's already used by other driver. Fixes: c7d8005 ("leds: class: Store the color index in struct led_classdev") Reported-by: Johannes Penßel <[email protected]> Closes: https://lore.kernel.org/r/[email protected] Link: https://bugzilla.kernel.org/show_bug.cgi?id=218045 Link: https://bugzilla.kernel.org/show_bug.cgi?id=218155 Link: https://bugzilla.suse.com/show_bug.cgi?id=1217172 Signed-off-by: Takashi Iwai <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent b85ea95 commit 8f2244c

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

Documentation/ABI/testing/sysfs-class-led

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,6 @@ Description:
5959
brightness. Reading this file when no hw brightness change
6060
event has happened will return an ENODATA error.
6161

62-
What: /sys/class/leds/<led>/color
63-
Date: June 2023
64-
KernelVersion: 6.5
65-
Description:
66-
Color of the LED.
67-
68-
This is a read-only file. Reading this file returns the color
69-
of the LED as a string (e.g: "red", "green", "multicolor").
70-
7162
What: /sys/class/leds/<led>/trigger
7263
Date: March 2006
7364
KernelVersion: 2.6.17

drivers/leds/led-class.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,6 @@ static ssize_t max_brightness_show(struct device *dev,
7575
}
7676
static DEVICE_ATTR_RO(max_brightness);
7777

78-
static ssize_t color_show(struct device *dev,
79-
struct device_attribute *attr, char *buf)
80-
{
81-
const char *color_text = "invalid";
82-
struct led_classdev *led_cdev = dev_get_drvdata(dev);
83-
84-
if (led_cdev->color < LED_COLOR_ID_MAX)
85-
color_text = led_colors[led_cdev->color];
86-
87-
return sysfs_emit(buf, "%s\n", color_text);
88-
}
89-
static DEVICE_ATTR_RO(color);
90-
9178
#ifdef CONFIG_LEDS_TRIGGERS
9279
static BIN_ATTR(trigger, 0644, led_trigger_read, led_trigger_write, 0);
9380
static struct bin_attribute *led_trigger_bin_attrs[] = {
@@ -102,7 +89,6 @@ static const struct attribute_group led_trigger_group = {
10289
static struct attribute *led_class_attrs[] = {
10390
&dev_attr_brightness.attr,
10491
&dev_attr_max_brightness.attr,
105-
&dev_attr_color.attr,
10692
NULL,
10793
};
10894

0 commit comments

Comments
 (0)