Skip to content

Commit 4dbf066

Browse files
t-8chlag-linaro
authored andcommitted
leds: leds-cros_ec: Skip LEDs without color components
A user reports that on their Lenovo Corsola Magneton with EC firmware steelix-15194.270.0 the driver probe fails with EINVAL. It turns out that the power LED does not contain any color components as indicated by the following "ectool led power query" output: Brightness range for LED 1: red : 0x0 green : 0x0 blue : 0x0 yellow : 0x0 white : 0x0 amber : 0x0 The LED also does not react to commands sent manually through ectool and is generally non-functional. Instead of failing the probe for all LEDs managed by the EC when one without color components is encountered, silently skip those. Cc: stable@vger.kernel.org Fixes: 8d6ce6f ("leds: Add ChromeOS EC driver") Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://patch.msgid.link/20251028-cros_ec-leds-no-colors-v1-1-ebe13a02022a@weissschuh.net Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 5246e36 commit 4dbf066

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/leds/leds-cros_ec.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,6 @@ static int cros_ec_led_count_subleds(struct device *dev,
142142
}
143143
}
144144

145-
if (!num_subleds)
146-
return -EINVAL;
147-
148145
*max_brightness = common_range;
149146
return num_subleds;
150147
}
@@ -189,6 +186,8 @@ static int cros_ec_led_probe_one(struct device *dev, struct cros_ec_device *cros
189186
&priv->led_mc_cdev.led_cdev.max_brightness);
190187
if (num_subleds < 0)
191188
return num_subleds;
189+
if (num_subleds == 0)
190+
return 0; /* LED without any colors, skip */
192191

193192
priv->cros_ec = cros_ec;
194193
priv->led_id = id;

0 commit comments

Comments
 (0)