aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/cx18
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-15 23:30:12 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-15 23:30:12 -0500
commit5d352e69c60e54b5f04d6e337a1d2bf0dbf3d94a (patch)
tree214e6b190715267ed02b6d415396c2bbcf2eaace /drivers/media/pci/cx18
parent93ea0eb7d77afab34657715630d692a78b8cea6a (diff)
parentf2ecc3d0787e05d9145722feed01d4a11ab6bec1 (diff)
Merge tag 'media/v4.15-1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab: - Documentation for digital TV (both kAPI and uAPI) are now in sync with the implementation (except for legacy/deprecated ioctls). This is a major step, as there were always a gap there - New sensor driver: imx274 - New cec driver: cec-gpio - New platform driver for rockship rga and tegra CEC - New RC driver: tango-ir - Several cleanups at atomisp driver - Core improvements for RC, CEC, V4L2 async probing support and DVB - Lots of drivers cleanup, fixes and improvements. * tag 'media/v4.15-1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (332 commits) dvb_frontend: don't use-after-free the frontend struct media: dib0700: fix invalid dvb_detach argument media: v4l2-ctrls: Don't validate BITMASK twice media: s5p-mfc: fix lockdep warning media: dvb-core: always call invoke_release() in fe_free() media: usb: dvb-usb-v2: dvb_usb_core: remove redundant code in dvb_usb_fe_sleep media: au0828: make const array addr_list static media: cx88: make const arrays default_addr_list and pvr2000_addr_list static media: drxd: make const array fastIncrDecLUT static media: usb: fix spelling mistake: "synchronuously" -> "synchronously" media: ddbridge: fix build warnings media: av7110: avoid 2038 overflow in debug print media: Don't do DMA on stack for firmware upload in the AS102 driver media: v4l: async: fix unregister for implicitly registered sub-device notifiers media: v4l: async: fix return of unitialized variable ret media: imx274: fix missing return assignment from call to imx274_mode_regs media: camss-vfe: always initialize reg at vfe_set_xbar_cfg() media: atomisp: make function calls cleaner media: atomisp: get rid of storage_class.h media: atomisp: get rid of wrong stddef.h include ...
Diffstat (limited to 'drivers/media/pci/cx18')
-rw-r--r--drivers/media/pci/cx18/cx18-driver.c28
-rw-r--r--drivers/media/pci/cx18/cx18-fileops.c4
-rw-r--r--drivers/media/pci/cx18/cx18-fileops.h2
-rw-r--r--drivers/media/pci/cx18/cx18-streams.c2
4 files changed, 17 insertions, 19 deletions
diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c
index 8654710464cc..8f314ca320c7 100644
--- a/drivers/media/pci/cx18/cx18-driver.c
+++ b/drivers/media/pci/cx18/cx18-driver.c
@@ -255,7 +255,7 @@ static void request_module_async(struct work_struct *work)
255 request_module("cx18-alsa"); 255 request_module("cx18-alsa");
256 256
257 /* Initialize cx18-alsa for this instance of the cx18 device */ 257 /* Initialize cx18-alsa for this instance of the cx18 device */
258 if (cx18_ext_init != NULL) 258 if (cx18_ext_init)
259 cx18_ext_init(dev); 259 cx18_ext_init(dev);
260} 260}
261 261
@@ -291,11 +291,11 @@ int cx18_msleep_timeout(unsigned int msecs, int intr)
291/* Release ioremapped memory */ 291/* Release ioremapped memory */
292static void cx18_iounmap(struct cx18 *cx) 292static void cx18_iounmap(struct cx18 *cx)
293{ 293{
294 if (cx == NULL) 294 if (!cx)
295 return; 295 return;
296 296
297 /* Release io memory */ 297 /* Release io memory */
298 if (cx->enc_mem != NULL) { 298 if (cx->enc_mem) {
299 CX18_DEBUG_INFO("releasing enc_mem\n"); 299 CX18_DEBUG_INFO("releasing enc_mem\n");
300 iounmap(cx->enc_mem); 300 iounmap(cx->enc_mem);
301 cx->enc_mem = NULL; 301 cx->enc_mem = NULL;
@@ -649,15 +649,15 @@ static void cx18_process_options(struct cx18 *cx)
649 CX18_INFO("User specified %s card\n", cx->card->name); 649 CX18_INFO("User specified %s card\n", cx->card->name);
650 else if (cx->options.cardtype != 0) 650 else if (cx->options.cardtype != 0)
651 CX18_ERR("Unknown user specified type, trying to autodetect card\n"); 651 CX18_ERR("Unknown user specified type, trying to autodetect card\n");
652 if (cx->card == NULL) { 652 if (!cx->card) {
653 if (cx->pci_dev->subsystem_vendor == CX18_PCI_ID_HAUPPAUGE) { 653 if (cx->pci_dev->subsystem_vendor == CX18_PCI_ID_HAUPPAUGE) {
654 cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT); 654 cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT);
655 CX18_INFO("Autodetected Hauppauge card\n"); 655 CX18_INFO("Autodetected Hauppauge card\n");
656 } 656 }
657 } 657 }
658 if (cx->card == NULL) { 658 if (!cx->card) {
659 for (i = 0; (cx->card = cx18_get_card(i)); i++) { 659 for (i = 0; (cx->card = cx18_get_card(i)); i++) {
660 if (cx->card->pci_list == NULL) 660 if (!cx->card->pci_list)
661 continue; 661 continue;
662 for (j = 0; cx->card->pci_list[j].device; j++) { 662 for (j = 0; cx->card->pci_list[j].device; j++) {
663 if (cx->pci_dev->device != 663 if (cx->pci_dev->device !=
@@ -676,7 +676,7 @@ static void cx18_process_options(struct cx18 *cx)
676 } 676 }
677done: 677done:
678 678
679 if (cx->card == NULL) { 679 if (!cx->card) {
680 cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT); 680 cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT);
681 CX18_ERR("Unknown card: vendor/device: [%04x:%04x]\n", 681 CX18_ERR("Unknown card: vendor/device: [%04x:%04x]\n",
682 cx->pci_dev->vendor, cx->pci_dev->device); 682 cx->pci_dev->vendor, cx->pci_dev->device);
@@ -698,7 +698,7 @@ static int cx18_create_in_workq(struct cx18 *cx)
698 snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in", 698 snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in",
699 cx->v4l2_dev.name); 699 cx->v4l2_dev.name);
700 cx->in_work_queue = alloc_ordered_workqueue("%s", 0, cx->in_workq_name); 700 cx->in_work_queue = alloc_ordered_workqueue("%s", 0, cx->in_workq_name);
701 if (cx->in_work_queue == NULL) { 701 if (!cx->in_work_queue) {
702 CX18_ERR("Unable to create incoming mailbox handler thread\n"); 702 CX18_ERR("Unable to create incoming mailbox handler thread\n");
703 return -ENOMEM; 703 return -ENOMEM;
704 } 704 }
@@ -909,12 +909,10 @@ static int cx18_probe(struct pci_dev *pci_dev,
909 return -ENOMEM; 909 return -ENOMEM;
910 } 910 }
911 911
912 cx = kzalloc(sizeof(struct cx18), GFP_ATOMIC); 912 cx = kzalloc(sizeof(*cx), GFP_ATOMIC);
913 if (cx == NULL) { 913 if (!cx)
914 printk(KERN_ERR "cx18: cannot manage card %d, out of memory\n",
915 i);
916 return -ENOMEM; 914 return -ENOMEM;
917 } 915
918 cx->pci_dev = pci_dev; 916 cx->pci_dev = pci_dev;
919 cx->instance = i; 917 cx->instance = i;
920 918
@@ -1256,7 +1254,7 @@ static void cx18_cancel_out_work_orders(struct cx18 *cx)
1256{ 1254{
1257 int i; 1255 int i;
1258 for (i = 0; i < CX18_MAX_STREAMS; i++) 1256 for (i = 0; i < CX18_MAX_STREAMS; i++)
1259 if (&cx->streams[i].video_dev != NULL) 1257 if (&cx->streams[i].video_dev)
1260 cancel_work_sync(&cx->streams[i].out_work_order); 1258 cancel_work_sync(&cx->streams[i].out_work_order);
1261} 1259}
1262 1260
@@ -1301,7 +1299,7 @@ static void cx18_remove(struct pci_dev *pci_dev)
1301 1299
1302 pci_disable_device(cx->pci_dev); 1300 pci_disable_device(cx->pci_dev);
1303 1301
1304 if (cx->vbi.sliced_mpeg_data[0] != NULL) 1302 if (cx->vbi.sliced_mpeg_data[0])
1305 for (i = 0; i < CX18_VBI_FRAMES; i++) 1303 for (i = 0; i < CX18_VBI_FRAMES; i++)
1306 kfree(cx->vbi.sliced_mpeg_data[i]); 1304 kfree(cx->vbi.sliced_mpeg_data[i]);
1307 1305
diff --git a/drivers/media/pci/cx18/cx18-fileops.c b/drivers/media/pci/cx18/cx18-fileops.c
index 98467b2089fa..4f9c2395941b 100644
--- a/drivers/media/pci/cx18/cx18-fileops.c
+++ b/drivers/media/pci/cx18/cx18-fileops.c
@@ -684,9 +684,9 @@ int cx18_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
684 return -EINVAL; 684 return -EINVAL;
685} 685}
686 686
687void cx18_vb_timeout(unsigned long data) 687void cx18_vb_timeout(struct timer_list *t)
688{ 688{
689 struct cx18_stream *s = (struct cx18_stream *)data; 689 struct cx18_stream *s = from_timer(s, t, vb_timeout);
690 struct cx18_videobuf_buffer *buf; 690 struct cx18_videobuf_buffer *buf;
691 unsigned long flags; 691 unsigned long flags;
692 692
diff --git a/drivers/media/pci/cx18/cx18-fileops.h b/drivers/media/pci/cx18/cx18-fileops.h
index 58b00b433708..37ef34e866cb 100644
--- a/drivers/media/pci/cx18/cx18-fileops.h
+++ b/drivers/media/pci/cx18/cx18-fileops.h
@@ -29,7 +29,7 @@ void cx18_stop_capture(struct cx18_open_id *id, int gop_end);
29void cx18_mute(struct cx18 *cx); 29void cx18_mute(struct cx18 *cx);
30void cx18_unmute(struct cx18 *cx); 30void cx18_unmute(struct cx18 *cx);
31int cx18_v4l2_mmap(struct file *file, struct vm_area_struct *vma); 31int cx18_v4l2_mmap(struct file *file, struct vm_area_struct *vma);
32void cx18_vb_timeout(unsigned long data); 32void cx18_vb_timeout(struct timer_list *t);
33 33
34/* Shared with cx18-alsa module */ 34/* Shared with cx18-alsa module */
35int cx18_claim_stream(struct cx18_open_id *id, int type); 35int cx18_claim_stream(struct cx18_open_id *id, int type);
diff --git a/drivers/media/pci/cx18/cx18-streams.c b/drivers/media/pci/cx18/cx18-streams.c
index 8385411af641..f35f78d66985 100644
--- a/drivers/media/pci/cx18/cx18-streams.c
+++ b/drivers/media/pci/cx18/cx18-streams.c
@@ -282,7 +282,7 @@ static void cx18_stream_init(struct cx18 *cx, int type)
282 INIT_WORK(&s->out_work_order, cx18_out_work_handler); 282 INIT_WORK(&s->out_work_order, cx18_out_work_handler);
283 283
284 INIT_LIST_HEAD(&s->vb_capture); 284 INIT_LIST_HEAD(&s->vb_capture);
285 setup_timer(&s->vb_timeout, cx18_vb_timeout, (unsigned long)s); 285 timer_setup(&s->vb_timeout, cx18_vb_timeout, 0);
286 spin_lock_init(&s->vb_lock); 286 spin_lock_init(&s->vb_lock);
287 if (type == CX18_ENC_STREAM_TYPE_YUV) { 287 if (type == CX18_ENC_STREAM_TYPE_YUV) {
288 spin_lock_init(&s->vbuf_q_lock); 288 spin_lock_init(&s->vbuf_q_lock);