usb: gadget: android: always update the sw_connected state
authorDima Zavin <dima@android.com>
Wed, 14 Sep 2011 22:12:45 +0000 (15:12 -0700)
committermgross <mark.gross@intel.com>
Wed, 9 Nov 2011 20:24:02 +0000 (12:24 -0800)
commit81f786076cf984e3d8da1179d12a51b1a7945ceb
tree187a296c88b880d76c21320d3ad9f37d99d69a94
parent04b13502754ac0e32862b0c14e029ef5944e33d2
usb: gadget: android: always update the sw_connected state

If we go through connected->configured->disconnected cycle very quickly,
it is possible that we may not generate a disconnect uevent to userspace.
Connected+configured could have happened before the work item got
executed, and thus would not have updated the sw_connected state. On
the disconnect, it would have noticed that a config is no longer there
but since sw_connected was still 0, it would not have sent the
disconnect event.

Change-Id: Id71175f784e3e1cf3f828bd8b24fceea1078a06b
Signed-off-by: Dima Zavin <dima@android.com>
drivers/usb/gadget/android.c