From e2c3373145e1714dfa5757f3d53fac287cfe336a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Wed, 1 Apr 2020 16:01:11 +0100 Subject: [PATCH] hidpp10: log errors when comitting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe LaĆ­ns --- src/driver-hidpp10.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/driver-hidpp10.c b/src/driver-hidpp10.c index b11177c7..81060ecf 100644 --- a/src/driver-hidpp10.c +++ b/src/driver-hidpp10.c @@ -558,8 +558,10 @@ hidpp10drv_commit(struct ratbag_device *device) continue; rc = hidpp10drv_write_button(&p, button, &action); - if (rc) + if (rc) { + log_error(device->ratbag, "hidpp10: failed to update buttons (%d)\n", rc); return RATBAG_ERROR_DEVICE; + } } ratbag_profile_for_each_led(profile, led) @@ -567,8 +569,10 @@ hidpp10drv_commit(struct ratbag_device *device) if (dev->profile_type != HIDPP10_PROFILE_UNKNOWN) { rc = hidpp10_set_profile(dev, profile->index, &p); - if (rc) + if (rc) { + log_error(device->ratbag, "hidpp10: failed to set profile (%d)\n", rc); return RATBAG_ERROR_DEVICE; + } } /* Update the current resolution in case it changed */ @@ -576,8 +580,10 @@ hidpp10drv_commit(struct ratbag_device *device) rc = hidpp10_set_current_resolution(dev, active_resolution->dpi_x, active_resolution->dpi_y); - if (rc) + if (rc) { + log_error(device->ratbag, "hidpp10: failed to set active resolution (%d)\n", rc); return RATBAG_ERROR_DEVICE; + } active_resolution = NULL; }