USB: serial: ch314: use usb_control_msg_recv()
authorHimadri Pandya <himadrispandya@gmail.com>
Fri, 1 Oct 2021 06:57:19 +0000 (08:57 +0200)
committerJohan Hovold <johan@kernel.org>
Wed, 27 Oct 2021 12:34:59 +0000 (14:34 +0200)
commit74f266455062c158f343bc3aa35ef84b3eb7adf1
tree1e202f251fc85e869d1ce81fea875cdf012f0cfb
parentc8345c0500de4411762db5941058e34979879128
USB: serial: ch314: use usb_control_msg_recv()

usb_control_msg_recv() is a new wrapper function for usb_control_msg()
that has error checks for short reads. This function also accepts data
buffer on stack. Hence use this function to simplify error handling for
short reads. Short reads will now get reported as -EREMOTEIO with no
indication of how short the transfer was.

Signed-off-by: Himadri Pandya <himadrispandya@gmail.com>
Link: https://lore.kernel.org/r/20211001065720.21330-2-himadrispandya@gmail.com
[ johan: fix quirk-detection breakage, style changes ]
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/ch341.c