diff options
author | Thierry Reding <thierry.reding@avionic-design.de> | 2011-08-04 04:14:10 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-08-31 17:17:18 -0300 |
commit | fc4eab2cbae547fb278c2583b77ee0ff7f5832d3 (patch) | |
tree | 9f82aea3471ce105c5df1ecdd6b9fc2ca600fc08 /drivers/staging/tm6000/tm6000-core.c | |
parent | c0fa65ff9e7fdbdea7bf1bbc02fb2c3ee6814cc7 (diff) | |
download | op-kernel-dev-fc4eab2cbae547fb278c2583b77ee0ff7f5832d3.zip op-kernel-dev-fc4eab2cbae547fb278c2583b77ee0ff7f5832d3.tar.gz |
[media] tm6000: Add locking for USB transfers
This commit introduces the usb_lock mutex to ensure that a USB request
always gets the proper response. While this is currently not really
necessary it will become important as there are more users.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/staging/tm6000/tm6000-core.c')
-rw-r--r-- | drivers/staging/tm6000/tm6000-core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/tm6000/tm6000-core.c b/drivers/staging/tm6000/tm6000-core.c index f85e5f2..31fdf15 100644 --- a/drivers/staging/tm6000/tm6000-core.c +++ b/drivers/staging/tm6000/tm6000-core.c @@ -39,6 +39,8 @@ int tm6000_read_write_usb(struct tm6000_core *dev, u8 req_type, u8 req, unsigned int pipe; u8 *data = NULL; + mutex_lock(&dev->usb_lock); + if (len) data = kzalloc(len, GFP_KERNEL); @@ -86,9 +88,9 @@ int tm6000_read_write_usb(struct tm6000_core *dev, u8 req_type, u8 req, } kfree(data); - msleep(5); + mutex_unlock(&dev->usb_lock); return ret; } |