summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2011-03-12 21:35:28 -0500
committerRohan Somvanshi <rsomvanshi@nvidia.com>2011-05-31 05:58:03 -0700
commit6cd10de16b93369d02f22c92b52d6a8303f73a37 (patch)
tree5d39d307db54a70c8953862928f137a9b9f1197b
parenta685399716e6e8950cccb3a3495543035d0d1691 (diff)
USB: gadget: f_accessory: Clear disconnected flag when driver file is opened
Fixes a race condition that can occur when entering accessory mode. Signed-off-by: Mike Lockwood <lockwood@android.com> (cherry picked from commit 2fc14f8dab1032958d2522576607f4a92abc3e3d) Change-Id: I3918f9351a7725783df7e7726d53fdbc0aff5b6c Reviewed-on: http://git-master/r/32890 Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com> Tested-by: Suresh Mangipudi <smangipudi@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--drivers/usb/gadget/f_accessory.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_accessory.c b/drivers/usb/gadget/f_accessory.c
index f6a5922e8c3b..baeae5976b66 100644
--- a/drivers/usb/gadget/f_accessory.c
+++ b/drivers/usb/gadget/f_accessory.c
@@ -521,6 +521,7 @@ static int acc_open(struct inode *ip, struct file *fp)
if (atomic_xchg(&_acc_dev->open_excl, 1))
return -EBUSY;
+ _acc_dev->disconnected = 0;
fp->private_data = _acc_dev;
return 0;
}