]> git.baikalelectronics.ru Git - kernel.git/commit
USB: usb-skeleton.c: add retry for nonblocking read
authorChen Wang <unicornxx.wang@gmail.com>
Fri, 19 Jul 2013 02:15:18 +0000 (10:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2013 19:01:13 +0000 (12:01 -0700)
commit0f75eab96cae1fea183c61851e020dcd652d2b49
treeb81f33befcac76ba7e7034e769bf3ce17afa76cc
parent1668d06f4bdad6b0898495d0b25d15c0533d5045
USB: usb-skeleton.c: add retry for nonblocking read

Updated skel_read() in usb-skeleton.c. When there is no data in the
buffer, we would allow retry for both blocking and nonblocking cases.
Original logic give retry only for blocking case. Actually we can also
allow retry for nonblocking case. This will reuse the existing retry
logic and handle the return of -EAGAIN in one place. Also if the data to
be read is short and can be retrieved in quick time, we can also give a
chance for nonblocking case and may catch the data and copy it back to
userspace in one read() call too.

Signed-off-by: Chen Wang <unicornxx.wang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/usb-skeleton.c