From 230647c7f3ef28938bb66745bf0c81082631af95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Sat, 3 Apr 2021 22:25:45 +0100 Subject: [PATCH] openinput: fail probe if we can't enumerate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These functions are mandatory[1], fail to probe if they fail. [1] https://github.com/openinput-fw/openinput-protocol/tree/master/specification/device-protocol#mandatory-functions Signed-off-by: Filipe LaĆ­ns --- src/driver-openinput.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/driver-openinput.c b/src/driver-openinput.c index 7a6edcd0..b9790259 100644 --- a/src/driver-openinput.c +++ b/src/driver-openinput.c @@ -437,16 +437,19 @@ openinput_probe(struct ratbag_device *device) openinput_info_version(device); ret = openinput_info_fw_info(device, OI_FUNCTION_FW_INFO_VENDOR, str, sizeof(str)); - if (!ret) - log_info(device->ratbag, "openinput: firmware vendor: %s\n", str); + if (ret) + return ret; + log_info(device->ratbag, "openinput: firmware vendor: %s\n", str); ret = openinput_info_fw_info(device, OI_FUNCTION_FW_INFO_VERSION, str, sizeof(str)); - if (!ret) - log_info(device->ratbag, "openinput: firmware version: %s\n", str); + if (ret) + return ret; + log_info(device->ratbag, "openinput: firmware version: %s\n", str); ret = openinput_info_fw_info(device, OI_FUNCTION_FW_INFO_DEVICE_NAME, str, sizeof(str)); - if (!ret) - log_info(device->ratbag, "openinput: device: %s\n", str); + if (ret) + return ret; + log_info(device->ratbag, "openinput: device: %s\n", str); ret = openinput_read_supported_function_pages(device); if (ret)