[PATCH] HID: hidraw: fix nonblock read return EAGAIN after device removed

2012-11-25 Thread founder.fang
Hi Linux-Input, Jiri, Dmitry, this patch is related to nonblock read on hidraw device. when nonblock read the condition check (file->f_flags & O_NONBLOCK) always be true, signal_pending and device exist checking never get a chance to run, so the user mode code always get EAGAIN even if device remov

[PATCH] HID: hidraw: fix nonblock read return EAGAIN after device removed

2012-11-20 Thread founder.fang
when nonblock read the condition check (file->f_flags & O_NONBLOCK) always be true, signal_pending and device exist checking never get a chance to run, so the user mode code always get EAGAIN even if device removed. move nonblock mode checking to the last can fix this problem. Signed-off-by: Found