Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae59dad4 authored by Mike Thomas's avatar Mike Thomas Committed by Greg Kroah-Hartman
Browse files

staging/easycap: Eliminate BKL



No locking is required for normal operation of the driver, but locking
is needed to prevent an Oops during some hot-unplugging scenarios.  The
BKL is replaced here by mutex locks together with traps to detect null
pointers following asynchronous device disconnection.

Signed-off-by: default avatarMike Thomas <rmthomas@sciolus.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2a87a0b9
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
config EASYCAP
	tristate "EasyCAP USB ID 05e1:0408 support"
	depends on USB && VIDEO_DEV
	depends on BKL # please fix

	---help---
	  This is an integrated audio/video driver for EasyCAP cards with
+1 −0
Original line number Diff line number Diff line
@@ -10,4 +10,5 @@ ccflags-y := -Wall
ccflags-y += -DEASYCAP_IS_VIDEODEV_CLIENT
ccflags-y += -DEASYCAP_NEEDS_V4L2_DEVICE_H
ccflags-y += -DEASYCAP_NEEDS_V4L2_FOPS
ccflags-y += -DEASYCAP_NEEDS_UNLOCKED_IOCTL
+14 −2
Original line number Diff line number Diff line
@@ -251,6 +251,12 @@ INTERLACE_MANY
 *  STRUCTURE DEFINITIONS
 */
/*---------------------------------------------------------------------------*/
struct easycap_dongle {
struct easycap *peasycap;
struct mutex mutex_video;
struct mutex mutex_audio;
};
/*---------------------------------------------------------------------------*/
struct data_buffer {
struct list_head list_head;
void *pgo;
@@ -491,7 +497,10 @@ struct data_buffer audio_buffer[];
void             easycap_complete(struct urb *);
int              easycap_open(struct inode *, struct file *);
int              easycap_release(struct inode *, struct file *);
long             easycap_ioctl(struct file *, unsigned int,  unsigned long);
long             easycap_ioctl_noinode(struct file *, unsigned int, \
								unsigned long);
int              easycap_ioctl(struct inode *, struct file *, unsigned int, \
								unsigned long);

/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
@@ -538,7 +547,10 @@ void easysnd_complete(struct urb *);
ssize_t          easysnd_read(struct file *, char __user *, size_t, loff_t *);
int              easysnd_open(struct inode *, struct file *);
int              easysnd_release(struct inode *, struct file *);
long             easysnd_ioctl(struct file *, unsigned int,  unsigned long);
long             easysnd_ioctl_noinode(struct file *, unsigned int, \
								unsigned long);
int              easysnd_ioctl(struct inode *, struct file *, unsigned int, \
								unsigned long);
unsigned int     easysnd_poll(struct file *, poll_table *);
void             easysnd_delete(struct kref *);
int              submit_audio_urbs(struct easycap *);
+1 −0
Original line number Diff line number Diff line
@@ -26,3 +26,4 @@
/*****************************************************************************/
extern int debug;
extern int gain;
extern struct easycap_dongle easycap_dongle[];
+338 −88

File changed.

Preview size limit exceeded, changes collapsed.

Loading