From df18c6b1aa0ab3b3ac77cb8d6f0bca57da276657 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 9 Feb 2017 08:55:10 +1000 Subject: [PATCH] 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 --- src/evdev-tablet-pad-leds.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/evdev-tablet-pad-leds.c b/src/evdev-tablet-pad-leds.c index 8ac00f51..209ab73a 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;