greybus: hd: fix host-device life time issues
authorJohan Hovold <johan@hovoldconsulting.com>
Wed, 4 Nov 2015 17:55:22 +0000 (18:55 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 5 Nov 2015 04:35:18 +0000 (20:35 -0800)
commitc1700479845bc36cb48719b2ae341d4df89a73f6
tree60aefe5a11e470a52aa53cc81e5962422df262b9
parentb4bd3617ed069a0aae701ed451cb6ec370fbd45f
greybus: hd: fix host-device life time issues

Fix host-device life time issues by separating host-device allocation
from registration.

This is needed both to make sure that all host-device resources are
available before registering the device and to prevent such resources
from being deallocated while the device is still in use during device
removal.

This specifically fixes the following warnings during es1 and es2
disconnect:

usb 1-1.1: No free CPort OUT urbs, having to dynamically allocate one!

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/es1.c
drivers/staging/greybus/es2.c
drivers/staging/greybus/hd.c
drivers/staging/greybus/hd.h