mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
roccat: remove spurious errors when waiting for the device to be ready
Not perfect but we need to figure out what 0x02 means eventually. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
@@ -278,7 +278,7 @@ roccat_is_ready(struct ratbag_device *device)
|
||||
msleep(100);
|
||||
|
||||
if (buf[1] == 0x02)
|
||||
return -EINVAL;
|
||||
return 2;
|
||||
|
||||
return buf[1] == 0x01;
|
||||
}
|
||||
@@ -298,6 +298,9 @@ roccat_wait_ready(struct ratbag_device *device)
|
||||
if (rc == 1)
|
||||
return 0;
|
||||
|
||||
if (rc == 2)
|
||||
return 2;
|
||||
|
||||
msleep(10);
|
||||
}
|
||||
|
||||
@@ -383,7 +386,7 @@ roccat_set_config_profile(struct ratbag_device *device, uint8_t profile, uint8_t
|
||||
return -EIO;
|
||||
|
||||
ret = roccat_wait_ready(device);
|
||||
if (ret)
|
||||
if (ret < 0)
|
||||
log_error(device->ratbag,
|
||||
"Error while waiting for the device to be ready: %s (%d)\n",
|
||||
strerror(-ret), ret);
|
||||
|
||||
Reference in New Issue
Block a user