USB: cp210x: relocate private data from USB interface to port
authorKonstantin Shkolnyy <konstantin.shkolnyy@gmail.com>
Wed, 28 Oct 2015 21:02:34 +0000 (16:02 -0500)
committerSasha Levin <sasha.levin@oracle.com>
Fri, 3 Jun 2016 15:30:35 +0000 (11:30 -0400)
commitb6e4114a6af19c2b91c29d9e56af20c3657c6711
treeac1fbeb217b473e6a960a50b98382624145a7dea
parentab3723486b8a1c904766f7cba545e9db91bb1f4c
USB: cp210x: relocate private data from USB interface to port

[ Upstream commit e2ae67a3b55188b0342522d8139acf013feb2a69 ]

This change is preparation for implementing a cp2108 bug workaround.
The workaround requires storing some private data. Right now the data is
attached to the USB interface and allocated in the attach() callback.
The bug detection requires USB I/O which is done easier from port_probe()
callback rather than attach(). Since the USB access functions take port
as a parameter, and since the private data is used exclusively by these
functions, it can be allocated in port_probe(). Also, all cp210x devices
have exactly 1 port per USB iterface, so moving private data from the USB
interface to port is trivial.

Signed-off-by: Konstantin Shkolnyy <konstantin.shkolnyy@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/usb/serial/cp210x.c