--- zzzz-none-000/linux-3.10.107/drivers/media/usb/cx231xx/cx231xx-vbi.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/media/usb/cx231xx/cx231xx-vbi.c 2021-02-04 17:41:59.000000000 +0000 @@ -19,12 +19,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "cx231xx.h" #include #include #include #include #include -#include #include #include #include @@ -32,11 +32,9 @@ #include #include -#include #include #include -#include "cx231xx.h" #include "cx231xx-vbi.h" static inline void print_err_status(struct cx231xx *dev, int packet, int status) @@ -70,11 +68,12 @@ break; } if (packet < 0) { - cx231xx_err("URB status %d [%s].\n", status, - errmsg); + dev_err(dev->dev, + "URB status %d [%s].\n", status, errmsg); } else { - cx231xx_err("URB packet %d, status %d [%s].\n", - packet, status, errmsg); + dev_err(dev->dev, + "URB packet %d, status %d [%s].\n", + packet, status, errmsg); } } @@ -193,8 +192,7 @@ struct cx231xx_fh *fh = vq->priv_data; struct cx231xx *dev = fh->dev; unsigned long flags = 0; - if (in_interrupt()) - BUG(); + BUG_ON(in_interrupt()); /* 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, @@ -317,8 +315,8 @@ case -ESHUTDOWN: return; default: /* error */ - cx231xx_err("urb completition error %d.\n", - urb->status); + dev_err(dev->dev, + "urb completition error %d.\n", urb->status); break; } @@ -332,8 +330,8 @@ urb->status = usb_submit_urb(urb, GFP_ATOMIC); if (urb->status) { - cx231xx_err("urb resubmit failed (error=%i)\n", - urb->status); + dev_err(dev->dev, "urb resubmit failed (error=%i)\n", + urb->status); } } @@ -345,7 +343,7 @@ struct urb *urb; int i; - cx231xx_info("called cx231xx_uninit_vbi_isoc\n"); + dev_dbg(dev->dev, "called cx231xx_uninit_vbi_isoc\n"); dev->vbi_mode.bulk_ctl.nfields = -1; for (i = 0; i < dev->vbi_mode.bulk_ctl.num_bufs; i++) { @@ -394,7 +392,7 @@ struct urb *urb; int rc; - cx231xx_info("called cx231xx_vbi_isoc\n"); + dev_dbg(dev->dev, "called cx231xx_vbi_isoc\n"); /* De-allocates all pending stuff */ cx231xx_uninit_vbi_isoc(dev); @@ -420,14 +418,16 @@ dev->vbi_mode.bulk_ctl.urb = kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL); if (!dev->vbi_mode.bulk_ctl.urb) { - cx231xx_errdev("cannot alloc memory for usb buffers\n"); + dev_err(dev->dev, + "cannot alloc memory for usb buffers\n"); return -ENOMEM; } dev->vbi_mode.bulk_ctl.transfer_buffer = kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL); if (!dev->vbi_mode.bulk_ctl.transfer_buffer) { - cx231xx_errdev("cannot allocate memory for usbtransfer\n"); + dev_err(dev->dev, + "cannot allocate memory for usbtransfer\n"); kfree(dev->vbi_mode.bulk_ctl.urb); return -ENOMEM; } @@ -442,7 +442,8 @@ urb = usb_alloc_urb(0, GFP_KERNEL); if (!urb) { - cx231xx_err("cannot alloc bulk_ctl.urb %i\n", i); + dev_err(dev->dev, + "cannot alloc bulk_ctl.urb %i\n", i); cx231xx_uninit_vbi_isoc(dev); return -ENOMEM; } @@ -452,9 +453,10 @@ dev->vbi_mode.bulk_ctl.transfer_buffer[i] = kzalloc(sb_size, GFP_KERNEL); if (!dev->vbi_mode.bulk_ctl.transfer_buffer[i]) { - cx231xx_err("unable to allocate %i bytes for transfer" - " buffer %i%s\n", sb_size, i, - in_interrupt() ? " while in int" : ""); + dev_err(dev->dev, + "unable to allocate %i bytes for transfer buffer %i%s\n", + sb_size, i, + in_interrupt() ? " while in int" : ""); cx231xx_uninit_vbi_isoc(dev); return -ENOMEM; } @@ -471,8 +473,8 @@ for (i = 0; i < dev->vbi_mode.bulk_ctl.num_bufs; i++) { rc = usb_submit_urb(dev->vbi_mode.bulk_ctl.urb[i], GFP_ATOMIC); if (rc) { - cx231xx_err("submit of urb %i failed (error=%i)\n", i, - rc); + dev_err(dev->dev, + "submit of urb %i failed (error=%i)\n", i, rc); cx231xx_uninit_vbi_isoc(dev); return rc; } @@ -523,7 +525,7 @@ struct cx231xx_buffer *buf) { /* Advice that buffer was filled */ - /* cx231xx_info("[%p/%d] wakeup\n", buf, buf->vb.i); */ + /* dev_dbg(dev->dev, "[%p/%d] wakeup\n", buf, buf->vb.i); */ buf->vb.state = VIDEOBUF_DONE; buf->vb.field_count++; @@ -615,7 +617,7 @@ char *outp; if (list_empty(&dma_q->active)) { - cx231xx_err("No active queue to serve\n"); + dev_err(dev->dev, "No active queue to serve\n"); dev->vbi_mode.bulk_ctl.buf = NULL; *buf = NULL; return;