fbd-dev-led: Ignore leds that can't handle patterns

While in theory we could have themes with only freq = 0 values we
currently assume there can be patterns.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
This commit is contained in:
Guido Günther
2025-05-06 14:54:52 +00:00
parent a2cbcc624f
commit 651c4f9fac
+9
View File
@@ -50,8 +50,17 @@ fbd_dev_led_probe_default (FbdDevLed *led, GError **error)
FbdDevLedPrivate *priv = fbd_dev_led_get_instance_private (led);
const gchar *name, *path;
gboolean success = FALSE;
const char *pattern;
name = g_udev_device_get_name (priv->dev);
pattern = g_udev_device_get_sysfs_attr (priv->dev, LED_PATTERN_ATTR);
if (!pattern) {
g_set_error (error,
G_FILE_ERROR, G_FILE_ERROR_FAILED,
"LED %s can't use patterns", name);
return FALSE;
}
for (int i = 0; i <= FBD_FEEDBACK_LED_COLOR_RGB; i++) {
g_autofree char *color = NULL;
g_autofree char *enum_name = NULL;