mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-12 11:36:35 +00:00
[media] usb drivers: use BUG_ON() instead of if () BUG
Some USB drivers have a logic at the VB buffer handling like: if (in_interrupt()) BUG(); Use, instead: BUG_ON(in_interrupt()); Btw, this logic looks weird on my eyes. We should convert them to use VB2, in order to avoid those crappy things. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
fa8cb6444c
commit
09f2082e23
5 changed files with 5 additions and 10 deletions
|
@ -1249,8 +1249,7 @@ static void free_buffer(struct videobuf_queue *vq, struct cx231xx_buffer *buf)
|
||||||
struct cx231xx *dev = fh->dev;
|
struct cx231xx *dev = fh->dev;
|
||||||
unsigned long flags = 0;
|
unsigned long flags = 0;
|
||||||
|
|
||||||
if (in_interrupt())
|
BUG_ON(in_interrupt());
|
||||||
BUG();
|
|
||||||
|
|
||||||
spin_lock_irqsave(&dev->video_mode.slock, flags);
|
spin_lock_irqsave(&dev->video_mode.slock, flags);
|
||||||
if (dev->USE_ISO) {
|
if (dev->USE_ISO) {
|
||||||
|
|
|
@ -192,8 +192,7 @@ static void free_buffer(struct videobuf_queue *vq, struct cx231xx_buffer *buf)
|
||||||
struct cx231xx_fh *fh = vq->priv_data;
|
struct cx231xx_fh *fh = vq->priv_data;
|
||||||
struct cx231xx *dev = fh->dev;
|
struct cx231xx *dev = fh->dev;
|
||||||
unsigned long flags = 0;
|
unsigned long flags = 0;
|
||||||
if (in_interrupt())
|
BUG_ON(in_interrupt());
|
||||||
BUG();
|
|
||||||
|
|
||||||
/* We used to wait for the buffer to finish here, but this didn't work
|
/* We used to wait for the buffer to finish here, but this didn't work
|
||||||
because, as we were keeping the state as VIDEOBUF_QUEUED,
|
because, as we were keeping the state as VIDEOBUF_QUEUED,
|
||||||
|
|
|
@ -749,8 +749,7 @@ static void free_buffer(struct videobuf_queue *vq, struct cx231xx_buffer *buf)
|
||||||
struct cx231xx *dev = fh->dev;
|
struct cx231xx *dev = fh->dev;
|
||||||
unsigned long flags = 0;
|
unsigned long flags = 0;
|
||||||
|
|
||||||
if (in_interrupt())
|
BUG_ON(in_interrupt());
|
||||||
BUG();
|
|
||||||
|
|
||||||
/* We used to wait for the buffer to finish here, but this didn't work
|
/* We used to wait for the buffer to finish here, but this didn't work
|
||||||
because, as we were keeping the state as VIDEOBUF_QUEUED,
|
because, as we were keeping the state as VIDEOBUF_QUEUED,
|
||||||
|
|
|
@ -714,8 +714,7 @@ static void free_buffer(struct videobuf_queue *vq, struct tm6000_buffer *buf)
|
||||||
struct tm6000_core *dev = fh->dev;
|
struct tm6000_core *dev = fh->dev;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
if (in_interrupt())
|
BUG_ON(in_interrupt());
|
||||||
BUG();
|
|
||||||
|
|
||||||
/* We used to wait for the buffer to finish here, but this didn't work
|
/* We used to wait for the buffer to finish here, but this didn't work
|
||||||
because, as we were keeping the state as VIDEOBUF_QUEUED,
|
because, as we were keeping the state as VIDEOBUF_QUEUED,
|
||||||
|
|
|
@ -377,8 +377,7 @@ static void free_buffer(struct videobuf_queue *vq, struct zr364xx_buffer *buf)
|
||||||
{
|
{
|
||||||
_DBG("%s\n", __func__);
|
_DBG("%s\n", __func__);
|
||||||
|
|
||||||
if (in_interrupt())
|
BUG_ON(in_interrupt());
|
||||||
BUG();
|
|
||||||
|
|
||||||
videobuf_vmalloc_free(&buf->vb);
|
videobuf_vmalloc_free(&buf->vb);
|
||||||
buf->vb.state = VIDEOBUF_NEEDS_INIT;
|
buf->vb.state = VIDEOBUF_NEEDS_INIT;
|
||||||
|
|
Loading…
Reference in a new issue