summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-02-09 08:55:10 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-02-09 08:56:19 +1000
commitdf18c6b1aa0ab3b3ac77cb8d6f0bca57da276657 (patch)
treea12013f1d6d0c30cf01949df7a8c32f202fc6765
parentcbe9a3bfc3c70992dc08934973a378da4f5314e5 (diff)
pad: don't warn about failure to initialize the LEDs on litest devices
We don't init the required /sysfs files, so let's not spew a lot of warnings during the test suite. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/evdev-tablet-pad-leds.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/evdev-tablet-pad-leds.c b/src/evdev-tablet-pad-leds.c
index 8ac00f5..209ab73 100644
--- a/src/evdev-tablet-pad-leds.c
+++ b/src/evdev-tablet-pad-leds.c
@@ -193,6 +193,13 @@ pad_group_new_basic(struct pad_dispatch *pad,
return group;
}
+static inline bool
+is_litest_device(struct evdev_device *device)
+{
+ return !!udev_device_get_property_value(device->udev_device,
+ "LIBINPUT_TEST_DEVICE");
+}
+
static inline struct pad_led_group *
pad_group_new(struct pad_dispatch *pad,
unsigned int group_index,
@@ -228,7 +235,11 @@ pad_group_new(struct pad_dispatch *pad,
return group;
error:
- log_error(libinput, "Unable to init LED group: %s\n", strerror(errno));
+ if (!is_litest_device(pad->device))
+ log_error(libinput,
+ "%s: unable to init LED group: %s\n",
+ pad->device->devname,
+ strerror(errno));
pad_led_group_destroy(&group->base);
return NULL;