OSDN Git Service

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)
committerDima Zavin <dima@android.com>
Wed, 14 Sep 2011 22:21:36 +0000 (15:21 -0700)
commitf85cf4f97dc037a3c8b309b3d0bdc55b3f7498cd
tree482779bcd0d77bd2eeb64db2a93bace5476b51d5
parentfc7534906acf0efd26abcd2aa971a453e9b51768
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