roccat: break infinite loops

When waiting for a status, the mouse sometimes answers 0x02, which seems
to be EINVAL (though it can be an ACK too). Treat this answer so we do
not end up in some infinite loops.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
Benjamin Tissoires
2015-09-15 10:36:10 -04:00
parent 8a99ed6436
commit ee0c58ca35

View File

@@ -277,6 +277,9 @@ roccat_is_ready(struct ratbag_device *device)
if (buf[1] == 0x03)
msleep(100);
if (buf[1] == 0x02)
return -EINVAL;
return buf[1] == 0x01;
}