summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-05-11 10:18:03 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2016-05-13 15:30:05 +0200
commite7b848c288dbcfb4b153ca5c772c8573caf739fb (patch)
treed568aa65117ee18777a118419c12288837c60d63 /drivers
parentf2aae1c6e60f2acd636c005951a2c932bc5c8d05 (diff)
greybus: es2: clean up cport-reset handling
Move handling of CPort-reset exceptions to the reset handler. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/greybus/es2.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c
index c8ee779bf3f9..f06a322f851a 100644
--- a/drivers/staging/greybus/es2.c
+++ b/drivers/staging/greybus/es2.c
@@ -506,6 +506,11 @@ static int cport_reset(struct gb_host_device *hd, u16 cport_id)
struct usb_device *udev = es2->usb_dev;
int retval;
+ switch (cport_id) {
+ case GB_SVC_CPORT_ID:
+ return 0;
+ }
+
retval = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
GB_APB_REQUEST_RESET_CPORT,
USB_DIR_OUT | USB_TYPE_VENDOR |
@@ -524,11 +529,9 @@ static int cport_enable(struct gb_host_device *hd, u16 cport_id)
{
int retval;
- if (cport_id != GB_SVC_CPORT_ID) {
- retval = cport_reset(hd, cport_id);
- if (retval)
- return retval;
- }
+ retval = cport_reset(hd, cport_id);
+ if (retval)
+ return retval;
return 0;
}