The patch number 7855 was added via Mauro Carvalho Chehab <[EMAIL PROTECTED]> to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward compatible with older kernels. Compatibility modifications will be removed before inclusion into the mainstream Kernel If anyone has any objections, please let us know by sending a message to: [EMAIL PROTECTED] ------ From: Mauro Carvalho Chehab <[EMAIL PROTECTED]> merge: http://www.linuxtv.org/hg/~hverkuil/v4l-dvb Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]> --- linux/drivers/media/video/cx18/cx18-driver.c | 8 ++++++-- linux/drivers/media/video/cx18/cx18-queue.c | 6 +++--- linux/drivers/media/video/cx18/cx18-streams.c | 13 ++++++++----- linux/drivers/media/video/cx18/cx18-streams.h | 2 +- linux/drivers/media/video/ivtv/ivtv-controls.c | 4 ++-- linux/drivers/media/video/ivtv/ivtv-driver.c | 8 ++++++-- linux/drivers/media/video/ivtv/ivtv-ioctl.c | 16 ++++++++-------- linux/drivers/media/video/ivtv/ivtv-ioctl.h | 6 +++--- linux/drivers/media/video/ivtv/ivtv-queue.c | 12 +++++++----- linux/drivers/media/video/ivtv/ivtv-streams.c | 13 ++++++++----- linux/drivers/media/video/ivtv/ivtv-streams.h | 2 +- linux/drivers/media/video/ivtv/ivtv-vbi.c | 3 ++- linux/drivers/media/video/ivtv/ivtv-yuv.c | 2 +- linux/drivers/media/video/ivtv/ivtvfb.c | 6 ++++-- 14 files changed, 60 insertions(+), 41 deletions(-) diff -r 41b3f12d6ce4 -r ecd047489c7c linux/drivers/media/video/cx18/cx18-driver.c --- a/linux/drivers/media/video/cx18/cx18-driver.c Tue May 06 11:09:01 2008 -0300 +++ b/linux/drivers/media/video/cx18/cx18-driver.c Tue May 06 15:25:14 2008 -0300 @@ -548,6 +548,7 @@ static int cx18_setup_pci(struct cx18 *c return 0; } +#ifdef MODULE static u32 cx18_request_module(struct cx18 *cx, u32 hw, const char *name, u32 id) { @@ -560,18 +561,21 @@ static u32 cx18_request_module(struct cx CX18_DEBUG_INFO("Loaded module %s\n", name); return hw; } +#endif static void cx18_load_and_init_modules(struct cx18 *cx) { u32 hw = cx->card->hw_all; int i; +#ifdef MODULE /* load modules */ #ifndef CONFIG_MEDIA_TUNER hw = cx18_request_module(cx, hw, "tuner", CX18_HW_TUNER); #endif #ifndef CONFIG_VIDEO_CS5345 hw = cx18_request_module(cx, hw, "cs5345", CX18_HW_CS5345); +#endif #endif /* check which i2c devices are actually found */ @@ -801,7 +805,7 @@ static int __devinit cx18_probe(struct p return 0; free_streams: - cx18_streams_cleanup(cx); + cx18_streams_cleanup(cx, 1); free_irq: free_irq(cx->dev->irq, (void *)cx); free_i2c: @@ -904,7 +908,7 @@ static void cx18_remove(struct pci_dev * cx18_halt_firmware(cx); - cx18_streams_cleanup(cx); + cx18_streams_cleanup(cx, 1); exit_cx18_i2c(cx); diff -r 41b3f12d6ce4 -r ecd047489c7c linux/drivers/media/video/cx18/cx18-queue.c --- a/linux/drivers/media/video/cx18/cx18-queue.c Tue May 06 11:09:01 2008 -0300 +++ b/linux/drivers/media/video/cx18/cx18-queue.c Tue May 06 15:25:14 2008 -0300 @@ -239,12 +239,12 @@ int cx18_stream_alloc(struct cx18_stream /* allocate stream buffers. Initially all buffers are in q_free. */ for (i = 0; i < s->buffers; i++) { - struct cx18_buffer *buf = - kzalloc(sizeof(struct cx18_buffer), GFP_KERNEL); + struct cx18_buffer *buf = kzalloc(sizeof(struct cx18_buffer), + GFP_KERNEL|__GFP_NOWARN); if (buf == NULL) break; - buf->buf = kmalloc(s->buf_size, GFP_KERNEL); + buf->buf = kmalloc(s->buf_size, GFP_KERNEL|__GFP_NOWARN); if (buf->buf == NULL) { kfree(buf); break; diff -r 41b3f12d6ce4 -r ecd047489c7c linux/drivers/media/video/cx18/cx18-streams.c --- a/linux/drivers/media/video/cx18/cx18-streams.c Tue May 06 11:09:01 2008 -0300 +++ b/linux/drivers/media/video/cx18/cx18-streams.c Tue May 06 15:25:14 2008 -0300 @@ -218,7 +218,7 @@ int cx18_streams_setup(struct cx18 *cx) return 0; /* One or more streams could not be initialized. Clean 'em all up. */ - cx18_streams_cleanup(cx); + cx18_streams_cleanup(cx, 0); return -ENOMEM; } @@ -296,12 +296,12 @@ int cx18_streams_register(struct cx18 *c return 0; /* One or more streams could not be initialized. Clean 'em all up. */ - cx18_streams_cleanup(cx); + cx18_streams_cleanup(cx, 1); return -ENOMEM; } /* Unregister v4l2 devices */ -void cx18_streams_cleanup(struct cx18 *cx) +void cx18_streams_cleanup(struct cx18 *cx, int unregister) { struct video_device *vdev; int type; @@ -319,8 +319,11 @@ void cx18_streams_cleanup(struct cx18 *c cx18_stream_free(&cx->streams[type]); - /* Unregister device */ - video_unregister_device(vdev); + /* Unregister or release device */ + if (unregister) + video_unregister_device(vdev); + else + video_device_release(vdev); } } diff -r 41b3f12d6ce4 -r ecd047489c7c linux/drivers/media/video/cx18/cx18-streams.h --- a/linux/drivers/media/video/cx18/cx18-streams.h Tue May 06 11:09:01 2008 -0300 +++ b/linux/drivers/media/video/cx18/cx18-streams.h Tue May 06 15:25:14 2008 -0300 @@ -24,7 +24,7 @@ u32 cx18_find_handle(struct cx18 *cx); u32 cx18_find_handle(struct cx18 *cx); int cx18_streams_setup(struct cx18 *cx); int cx18_streams_register(struct cx18 *cx); -void cx18_streams_cleanup(struct cx18 *cx); +void cx18_streams_cleanup(struct cx18 *cx, int unregister); /* Capture related */ int cx18_start_v4l2_encode_stream(struct cx18_stream *s); diff -r 41b3f12d6ce4 -r ecd047489c7c linux/drivers/media/video/ivtv/ivtv-controls.c --- a/linux/drivers/media/video/ivtv/ivtv-controls.c Tue May 06 11:09:01 2008 -0300 +++ b/linux/drivers/media/video/ivtv/ivtv-controls.c Tue May 06 15:25:14 2008 -0300 @@ -181,12 +181,12 @@ static int ivtv_setup_vbi_fmt(struct ivt return 0; } /* Need sliced data for mpeg insertion */ - if (get_service_set(itv->vbi.sliced_in) == 0) { + if (ivtv_get_service_set(itv->vbi.sliced_in) == 0) { if (itv->is_60hz) itv->vbi.sliced_in->service_set = V4L2_SLICED_CAPTION_525; else itv->vbi.sliced_in->service_set = V4L2_SLICED_WSS_625; - expand_service_set(itv->vbi.sliced_in, itv->is_50hz); + ivtv_expand_service_set(itv->vbi.sliced_in, itv->is_50hz); } return 0; } diff -r 41b3f12d6ce4 -r ecd047489c7c linux/drivers/media/video/ivtv/ivtv-driver.c --- a/linux/drivers/media/video/ivtv/ivtv-driver.c Tue May 06 11:09:01 2008 -0300 +++ b/linux/drivers/media/video/ivtv/ivtv-driver.c Tue May 06 15:25:14 2008 -0300 @@ -857,6 +857,7 @@ static int ivtv_setup_pci(struct ivtv *i return 0; } +#ifdef MODULE static u32 ivtv_request_module(struct ivtv *itv, u32 hw, const char *name, u32 id) { @@ -869,12 +870,14 @@ static u32 ivtv_request_module(struct iv IVTV_DEBUG_INFO("Loaded module %s\n", name); return hw; } +#endif static void ivtv_load_and_init_modules(struct ivtv *itv) { u32 hw = itv->card->hw_all; unsigned i; +#ifdef MODULE /* load modules */ #ifndef CONFIG_MEDIA_TUNER hw = ivtv_request_module(itv, hw, "tuner", IVTV_HW_TUNER); @@ -914,6 +917,7 @@ static void ivtv_load_and_init_modules(s #endif #ifndef CONFIG_VIDEO_M52790 hw = ivtv_request_module(itv, hw, "m52790", IVTV_HW_M52790); +#endif #endif /* check which i2c devices are actually found */ @@ -1232,7 +1236,7 @@ static int __devinit ivtv_probe(struct p return 0; free_streams: - ivtv_streams_cleanup(itv); + ivtv_streams_cleanup(itv, 1); free_irq: free_irq(itv->dev->irq, (void *)itv); free_i2c: @@ -1377,7 +1381,7 @@ static void ivtv_remove(struct pci_dev * flush_workqueue(itv->irq_work_queues); destroy_workqueue(itv->irq_work_queues); - ivtv_streams_cleanup(itv); + ivtv_streams_cleanup(itv, 1); ivtv_udma_free(itv); exit_ivtv_i2c(itv); diff -r 41b3f12d6ce4 -r ecd047489c7c linux/drivers/media/video/ivtv/ivtv-ioctl.c --- a/linux/drivers/media/video/ivtv/ivtv-ioctl.c Tue May 06 11:09:01 2008 -0300 +++ b/linux/drivers/media/video/ivtv/ivtv-ioctl.c Tue May 06 15:25:14 2008 -0300 @@ -38,7 +38,7 @@ #include <linux/dvb/audio.h> #include <linux/i2c-id.h> -u16 service2vbi(int type) +u16 ivtv_service2vbi(int type) { switch (type) { case V4L2_SLICED_TELETEXT_B: @@ -88,7 +88,7 @@ static u16 select_service_from_set(int f return 0; } -void expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal) +void ivtv_expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal) { u16 set = fmt->service_set; int f, l; @@ -115,7 +115,7 @@ static int check_service_set(struct v4l2 return set != 0; } -u16 get_service_set(struct v4l2_sliced_vbi_format *fmt) +u16 ivtv_get_service_set(struct v4l2_sliced_vbi_format *fmt) { int f, l; u16 set = 0; @@ -466,7 +466,7 @@ static int ivtv_get_fmt(struct ivtv *itv vbifmt->service_lines[0][23] = V4L2_SLICED_WSS_625; vbifmt->service_lines[0][16] = V4L2_SLICED_VPS; } - vbifmt->service_set = get_service_set(vbifmt); + vbifmt->service_set = ivtv_get_service_set(vbifmt); break; } @@ -481,12 +481,12 @@ static int ivtv_get_fmt(struct ivtv *itv if (streamtype == IVTV_DEC_STREAM_TYPE_VBI) { vbifmt->service_set = itv->is_50hz ? V4L2_SLICED_VBI_625 : V4L2_SLICED_VBI_525; - expand_service_set(vbifmt, itv->is_50hz); + ivtv_expand_service_set(vbifmt, itv->is_50hz); break; } itv->video_dec_func(itv, VIDIOC_G_FMT, fmt); - vbifmt->service_set = get_service_set(vbifmt); + vbifmt->service_set = ivtv_get_service_set(vbifmt); break; } case V4L2_BUF_TYPE_VBI_OUTPUT: @@ -646,9 +646,9 @@ static int ivtv_try_or_set_fmt(struct iv memset(vbifmt->reserved, 0, sizeof(vbifmt->reserved)); if (vbifmt->service_set) - expand_service_set(vbifmt, itv->is_50hz); + ivtv_expand_service_set(vbifmt, itv->is_50hz); set = check_service_set(vbifmt, itv->is_50hz); - vbifmt->service_set = get_service_set(vbifmt); + vbifmt->service_set = ivtv_get_service_set(vbifmt); if (!set_fmt) return 0; diff -r 41b3f12d6ce4 -r ecd047489c7c linux/drivers/media/video/ivtv/ivtv-ioctl.h --- a/linux/drivers/media/video/ivtv/ivtv-ioctl.h Tue May 06 11:09:01 2008 -0300 +++ b/linux/drivers/media/video/ivtv/ivtv-ioctl.h Tue May 06 15:25:14 2008 -0300 @@ -21,9 +21,9 @@ #ifndef IVTV_IOCTL_H #define IVTV_IOCTL_H -u16 service2vbi(int type); -void expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal); -u16 get_service_set(struct v4l2_sliced_vbi_format *fmt); +u16 ivtv_service2vbi(int type); +void ivtv_expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal); +u16 ivtv_get_service_set(struct v4l2_sliced_vbi_format *fmt); int ivtv_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void *arg); diff -r 41b3f12d6ce4 -r ecd047489c7c linux/drivers/media/video/ivtv/ivtv-queue.c --- a/linux/drivers/media/video/ivtv/ivtv-queue.c Tue May 06 11:09:01 2008 -0300 +++ b/linux/drivers/media/video/ivtv/ivtv-queue.c Tue May 06 15:25:14 2008 -0300 @@ -203,14 +203,14 @@ int ivtv_stream_alloc(struct ivtv_stream s->dma != PCI_DMA_NONE ? "DMA " : "", s->name, s->buffers, s->buf_size, s->buffers * s->buf_size / 1024); - s->sg_pending = kzalloc(SGsize, GFP_KERNEL); + s->sg_pending = kzalloc(SGsize, GFP_KERNEL|__GFP_NOWARN); if (s->sg_pending == NULL) { IVTV_ERR("Could not allocate sg_pending for %s stream\n", s->name); return -ENOMEM; } s->sg_pending_size = 0; - s->sg_processing = kzalloc(SGsize, GFP_KERNEL); + s->sg_processing = kzalloc(SGsize, GFP_KERNEL|__GFP_NOWARN); if (s->sg_processing == NULL) { IVTV_ERR("Could not allocate sg_processing for %s stream\n", s->name); kfree(s->sg_pending); @@ -219,7 +219,8 @@ int ivtv_stream_alloc(struct ivtv_stream } s->sg_processing_size = 0; - s->sg_dma = kzalloc(sizeof(struct ivtv_sg_element), GFP_KERNEL); + s->sg_dma = kzalloc(sizeof(struct ivtv_sg_element), + GFP_KERNEL|__GFP_NOWARN); if (s->sg_dma == NULL) { IVTV_ERR("Could not allocate sg_dma for %s stream\n", s->name); kfree(s->sg_pending); @@ -235,11 +236,12 @@ int ivtv_stream_alloc(struct ivtv_stream /* allocate stream buffers. Initially all buffers are in q_free. */ for (i = 0; i < s->buffers; i++) { - struct ivtv_buffer *buf = kzalloc(sizeof(struct ivtv_buffer), GFP_KERNEL); + struct ivtv_buffer *buf = kzalloc(sizeof(struct ivtv_buffer), + GFP_KERNEL|__GFP_NOWARN); if (buf == NULL) break; - buf->buf = kmalloc(s->buf_size + 256, GFP_KERNEL); + buf->buf = kmalloc(s->buf_size + 256, GFP_KERNEL|__GFP_NOWARN); if (buf->buf == NULL) { kfree(buf); break; diff -r 41b3f12d6ce4 -r ecd047489c7c linux/drivers/media/video/ivtv/ivtv-streams.c --- a/linux/drivers/media/video/ivtv/ivtv-streams.c Tue May 06 11:09:01 2008 -0300 +++ b/linux/drivers/media/video/ivtv/ivtv-streams.c Tue May 06 15:25:14 2008 -0300 @@ -244,7 +244,7 @@ int ivtv_streams_setup(struct ivtv *itv) return 0; /* One or more streams could not be initialized. Clean 'em all up. */ - ivtv_streams_cleanup(itv); + ivtv_streams_cleanup(itv, 0); return -ENOMEM; } @@ -304,12 +304,12 @@ int ivtv_streams_register(struct ivtv *i return 0; /* One or more streams could not be initialized. Clean 'em all up. */ - ivtv_streams_cleanup(itv); + ivtv_streams_cleanup(itv, 1); return -ENOMEM; } /* Unregister v4l2 devices */ -void ivtv_streams_cleanup(struct ivtv *itv) +void ivtv_streams_cleanup(struct ivtv *itv, int unregister) { int type; @@ -322,8 +322,11 @@ void ivtv_streams_cleanup(struct ivtv *i continue; ivtv_stream_free(&itv->streams[type]); - /* Unregister device */ - video_unregister_device(vdev); + /* Unregister or release device */ + if (unregister) + video_unregister_device(vdev); + else + video_device_release(vdev); } } diff -r 41b3f12d6ce4 -r ecd047489c7c linux/drivers/media/video/ivtv/ivtv-streams.h --- a/linux/drivers/media/video/ivtv/ivtv-streams.h Tue May 06 11:09:01 2008 -0300 +++ b/linux/drivers/media/video/ivtv/ivtv-streams.h Tue May 06 15:25:14 2008 -0300 @@ -23,7 +23,7 @@ int ivtv_streams_setup(struct ivtv *itv); int ivtv_streams_register(struct ivtv *itv); -void ivtv_streams_cleanup(struct ivtv *itv); +void ivtv_streams_cleanup(struct ivtv *itv, int unregister); /* Capture related */ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s); diff -r 41b3f12d6ce4 -r ecd047489c7c linux/drivers/media/video/ivtv/ivtv-vbi.c --- a/linux/drivers/media/video/ivtv/ivtv-vbi.c Tue May 06 11:09:01 2008 -0300 +++ b/linux/drivers/media/video/ivtv/ivtv-vbi.c Tue May 06 15:25:14 2008 -0300 @@ -169,7 +169,8 @@ static void copy_vbi_data(struct ivtv *i linemask[0] |= (1 << l); else linemask[1] |= (1 << (l - 32)); - dst[sd + 12 + line * 43] = service2vbi(itv->vbi.sliced_data[i].id); + dst[sd + 12 + line * 43] = + ivtv_service2vbi(itv->vbi.sliced_data[i].id); memcpy(dst + sd + 12 + line * 43 + 1, itv->vbi.sliced_data[i].data, 42); line++; } diff -r 41b3f12d6ce4 -r ecd047489c7c linux/drivers/media/video/ivtv/ivtv-yuv.c --- a/linux/drivers/media/video/ivtv/ivtv-yuv.c Tue May 06 11:09:01 2008 -0300 +++ b/linux/drivers/media/video/ivtv/ivtv-yuv.c Tue May 06 15:25:14 2008 -0300 @@ -908,7 +908,7 @@ static void ivtv_yuv_init(struct ivtv *i } /* We need a buffer for blanking when Y plane is offset - non-fatal if we can't get one */ - yi->blanking_ptr = kzalloc(720 * 16, GFP_KERNEL); + yi->blanking_ptr = kzalloc(720 * 16, GFP_KERNEL|__GFP_NOWARN); if (yi->blanking_ptr) { yi->blanking_dmaptr = pci_map_single(itv->dev, yi->blanking_ptr, 720*16, PCI_DMA_TODEVICE); } else { diff -r 41b3f12d6ce4 -r ecd047489c7c linux/drivers/media/video/ivtv/ivtvfb.c --- a/linux/drivers/media/video/ivtv/ivtvfb.c Tue May 06 11:09:01 2008 -0300 +++ b/linux/drivers/media/video/ivtv/ivtvfb.c Tue May 06 15:25:14 2008 -0300 @@ -948,7 +948,8 @@ static int ivtvfb_init_vidmode(struct iv } /* Allocate the pseudo palette */ - oi->ivtvfb_info.pseudo_palette = kmalloc(sizeof(u32) * 16, GFP_KERNEL); + oi->ivtvfb_info.pseudo_palette = + kmalloc(sizeof(u32) * 16, GFP_KERNEL|__GFP_NOWARN); if (!oi->ivtvfb_info.pseudo_palette) { IVTVFB_ERR("abort, unable to alloc pseudo pallete\n"); @@ -1056,7 +1057,8 @@ static int ivtvfb_init_card(struct ivtv return -EBUSY; } - itv->osd_info = kzalloc(sizeof(struct osd_info), GFP_ATOMIC); + itv->osd_info = kzalloc(sizeof(struct osd_info), + GFP_ATOMIC|__GFP_NOWARN); if (itv->osd_info == NULL) { IVTVFB_ERR("Failed to allocate memory for osd_info\n"); return -ENOMEM; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/ecd047489c7c217967deb5edc7d0e2ac7e8e5b02 _______________________________________________ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits