diff options
author | Mike Thomas <rmthomas@sciolus.org> | 2010-11-07 19:58:55 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-11-09 16:31:14 -0800 |
commit | e68703cfe8dd2f5605c53b46fae6c9c027e7ef50 (patch) | |
tree | 5bd184a964cc5385627f1ffbc5842e0028b6a387 /drivers/staging/easycap/easycap_low.c | |
parent | ce36cedab3f865969653bf4360f7e364ab0937e4 (diff) | |
download | op-kernel-dev-e68703cfe8dd2f5605c53b46fae6c9c027e7ef50.zip op-kernel-dev-e68703cfe8dd2f5605c53b46fae6c9c027e7ef50.tar.gz |
staging/easycap: Make code re-entrant
In order to allow multiple EasyCAP dongles to operate simultaneously
without mutual interference all static variables have been eliminated
except for a persistent inventory of plugged-in dongles at module level.
Signed-off-by: Mike Thomas <rmthomas@sciolus.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/easycap/easycap_low.c')
-rw-r--r-- | drivers/staging/easycap/easycap_low.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/staging/easycap/easycap_low.c b/drivers/staging/easycap/easycap_low.c index 709c3d9..a3be9c1e 100644 --- a/drivers/staging/easycap/easycap_low.c +++ b/drivers/staging/easycap/easycap_low.c @@ -783,6 +783,12 @@ return usb_control_msg(pusb_device, usb_sndctrlpipe(pusb_device, 0), \ (int)50000); } /*****************************************************************************/ +int +audio_setup(struct easycap *peasycap) +{ +struct usb_device *pusb_device; +unsigned char buffer[1]; +int rc, id1, id2; /*---------------------------------------------------------------------------*/ /* * IMPORTANT: @@ -791,20 +797,12 @@ return usb_control_msg(pusb_device, usb_sndctrlpipe(pusb_device, 0), \ * TO ENABLE AUDIO THE VALUE 0x0200 MUST BE SENT. */ /*---------------------------------------------------------------------------*/ -int -audio_setup(struct easycap *peasycap) -{ -struct usb_device *pusb_device; -static __u8 request = 0x01; -static __u8 requesttype = \ +const __u8 request = 0x01; +const __u8 requesttype = \ (__u8)(USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE); - -static __u16 value_unmute = 0x0200; -static __u16 index = 0x0301; - -static unsigned char buffer[1]; -static __u16 length = 1; -int rc, id1, id2; +const __u16 value_unmute = 0x0200; +const __u16 index = 0x0301; +const __u16 length = 1; if (NULL == peasycap) return -EFAULT; |