1
0
forked from drath/libratbag

openinput: fail probe if we can't enumerate

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 <lains@riseup.net>
This commit is contained in:
Filipe Laíns
2021-04-03 22:25:45 +01:00
committed by Filipe Laíns
parent 3f99446a1b
commit 230647c7f3

View File

@@ -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)