Input: serio_raw - ensure we don't block in non-blocking read
Avoid calling wait_event_interruptible() if client requested non-blocking read, since it is not guaranteed that another thread will not consume event after we checked if serio_raw->head != serio_raw->tail. Also ensure we do not return 0 but keep waiting instead in blocking case, when another thread steals "our" byte. Reviewed-by: NDavid Herrmann <dh.herrmann@googlemail.com> Reviewed-by: NChe-Liang Chiou <clchiou@chromium.org> Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
Showing
想要评论请 注册 或 登录