From c2e2f9cf060721fca1254b0a9a61aca1e3068080 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Sat, 12 Mar 2011 21:35:28 -0500 Subject: USB: gadget: f_accessory: Clear disconnected flag when driver file is opened Fixes a race condition that can occur when entering accessory mode. Change-Id: I9d67c141b604e053296f8ec761f0d4b910de2bc7 Signed-off-by: Mike Lockwood Signed-off-by: Pavankumar Kondeti Signed-off-by: Shruthi Krishna --- drivers/usb/gadget/f_accessory.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') 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; } -- cgit v1.2.3