Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb:
  V4L/DVB (7367): bug #10211: Fix depencencies for cx2341x
  V4L/DVB (7362): tvp5150.c: logical-bitwise and confusion
  V4L/DVB (7334): usb video: add a device link to usbvideo devices, else hal will ignore them
  V4L/DVB (7330): V4L1 - fix v4l_compat_translate_ioctl possible NULL deref
  V4L/DVB (7328): usb/opera1.c: fix a memory leak
  V4L/DVB (7291): em28xx: correct use of and fix
  V4L/DVB (7285): em28xx: Correct use of ! and &
  V4L/DVB (7279): ivtv: Add missing sg_init_table()
  V4L/DVB (7268): saa7134: fix: tuner should be loaded before calling saa7134_board_init2()
  V4L/DVB (7267): cx88: Fix: Loads tuner module before sending commands to it
  V4L/DVB (7251): VIDEO_VIVI must depend on VIDEO_DEV
  V4L/DVB (7242): ivtv: fix for yuv filter table check
  V4L/DVB (7236): bttv: struct member initialized twice
  V4L/DVB (7228): saa7134: fix FM radio support for the Pinnacle PCTV 110i
  • Loading branch information
Linus Torvalds committed Mar 20, 2008
2 parents aedb60a + eee4470 commit ba42242
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 50 deletions.
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/opera1.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,9 @@ static int opera1_xilinx_load_firmware(struct usb_device *dev,
err("could not restart the USB controller CPU.");
ret = -EINVAL;
}
kfree(p);
}
}
kfree(p);
if (fw) {
release_firmware(fw);
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/video/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ comment "MPEG video encoders"

config VIDEO_CX2341X
tristate "Conexant CX2341x MPEG encoders"
depends on VIDEO_V4L2 && EXPERIMENTAL
depends on VIDEO_V4L2 && EXPERIMENTAL && VIDEO_V4L2_COMMON
---help---
Support for the Conexant CX23416 MPEG encoders
and CX23415 MPEG encoder/decoders.
Expand Down Expand Up @@ -382,7 +382,7 @@ endmenu # encoder / decoder chips

config VIDEO_VIVI
tristate "Virtual Video Driver"
depends on VIDEO_V4L2 && !SPARC32 && !SPARC64
depends on VIDEO_DEV && VIDEO_V4L2 && !SPARC32 && !SPARC64
select VIDEOBUF_VMALLOC
default n
---help---
Expand Down
1 change: 0 additions & 1 deletion drivers/media/video/bt8xx/bttv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3388,7 +3388,6 @@ static struct video_device bttv_video_template =
#ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf = vidiocgmbuf,
#endif
.vidioc_g_crop = bttv_g_crop,
.vidioc_g_crop = bttv_g_crop,
.vidioc_s_crop = bttv_s_crop,
.vidioc_g_fbuf = bttv_g_fbuf,
Expand Down
5 changes: 5 additions & 0 deletions drivers/media/video/cx88/cx88-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -2196,6 +2196,11 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
cx88_reset(core);
cx88_card_setup_pre_i2c(core);
cx88_i2c_init(core, pci);

/* load tuner module, if needed */
if (TUNER_ABSENT != core->board.tuner_type)
request_module("tuner");

cx88_call_i2c_clients (core, TUNER_SET_STANDBY, NULL);
cx88_card_setup(core);
cx88_ir_init(core, pci);
Expand Down
2 changes: 0 additions & 2 deletions drivers/media/video/cx88/cx88-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1826,8 +1826,6 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
cx_set(MO_PCI_INTMSK, core->pci_irqmask);

/* load and configure helper modules */
if (TUNER_ABSENT != core->board.tuner_type)
request_module("tuner");

if (core->board.audio_chip == AUDIO_CHIP_WM8775)
request_module("wm8775");
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/em28xx/em28xx-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ static int em28xx_write_ac97(struct em28xx *dev, u8 reg, u8 *val)
for (i = 0; i < 10; i++) {
if ((ret = em28xx_read_reg(dev, AC97BUSY_REG)) < 0)
return ret;
if (!((u8) ret) & 0x01)
if (!(ret & 0x01))
return 0;
msleep(5);
}
Expand Down
7 changes: 3 additions & 4 deletions drivers/media/video/ivtv/ivtv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
#include "ivtv-vbi.h"
#include "ivtv-routing.h"
#include "ivtv-gpio.h"
#include "ivtv-yuv.h"

#include <media/tveeprom.h>
#include <media/saa7115.h>
Expand Down Expand Up @@ -700,6 +699,9 @@ static int __devinit ivtv_init_struct1(struct ivtv *itv)
itv->vbi.in.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE;
itv->vbi.sliced_in = &itv->vbi.in.fmt.sliced;

/* Init the sg table for osd/yuv output */
sg_init_table(itv->udma.SGlist, IVTV_DMA_SG_OSD_ENT);

/* OSD */
itv->osd_global_alpha_state = 1;
itv->osd_global_alpha = 255;
Expand Down Expand Up @@ -1053,9 +1055,6 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
goto free_io;
}

/* Check yuv output filter table */
if (itv->has_cx23415) ivtv_yuv_filter_check(itv);

ivtv_gpio_init(itv);

/* active i2c */
Expand Down
8 changes: 6 additions & 2 deletions drivers/media/video/ivtv/ivtv-firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "ivtv-driver.h"
#include "ivtv-mailbox.h"
#include "ivtv-firmware.h"
#include "ivtv-yuv.h"
#include <linux/firmware.h>

#define IVTV_MASK_SPU_ENABLE 0xFFFFFFFE
Expand Down Expand Up @@ -225,11 +226,14 @@ int ivtv_firmware_init(struct ivtv *itv)
return 0;

itv->dec_mbox.mbox = ivtv_search_mailbox(itv->dec_mem, IVTV_DECODER_SIZE);
if (itv->dec_mbox.mbox == NULL)
if (itv->dec_mbox.mbox == NULL) {
IVTV_ERR("Decoder mailbox not found\n");
else if (itv->has_cx23415 && ivtv_vapi(itv, CX2341X_DEC_PING_FW, 0)) {
} else if (itv->has_cx23415 && ivtv_vapi(itv, CX2341X_DEC_PING_FW, 0)) {
IVTV_ERR("Decoder firmware dead!\n");
itv->dec_mbox.mbox = NULL;
} else {
/* Firmware okay, so check yuv output filter table */
ivtv_yuv_filter_check(itv);
}
return itv->dec_mbox.mbox ? 0 : -ENODEV;
}
Expand Down
41 changes: 21 additions & 20 deletions drivers/media/video/saa7134/saa7134-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -2484,27 +2484,28 @@ struct saa7134_board saa7134_boards[] = {
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
.gpiomask = 0x080200000,
.inputs = {{
.name = name_tv,
.vmux = 4,
.amux = TV,
.tv = 1,
},{
.name = name_comp1,
.vmux = 1,
.amux = LINE2,
},{
.name = name_comp2,
.vmux = 0,
.amux = LINE2,
},{
.name = name_svideo,
.vmux = 8,
.amux = LINE2,
}},
.inputs = { {
.name = name_tv,
.vmux = 4,
.amux = TV,
.tv = 1,
}, {
.name = name_comp1,
.vmux = 1,
.amux = LINE2,
}, {
.name = name_comp2,
.vmux = 0,
.amux = LINE2,
}, {
.name = name_svideo,
.vmux = 8,
.amux = LINE2,
} },
.radio = {
.name = name_radio,
.amux = LINE1,
.name = name_radio,
.amux = TV,
.gpio = 0x0200000,
},
},
[SAA7134_BOARD_ASUSTeK_P7131_DUAL] = {
Expand Down
5 changes: 3 additions & 2 deletions drivers/media/video/saa7134/saa7134-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1022,12 +1022,13 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
saa7134_i2c_register(dev);

/* initialize hardware #2 */
if (TUNER_ABSENT != dev->tuner_type)
request_module("tuner");
saa7134_board_init2(dev);

saa7134_hwinit2(dev);

/* load i2c helpers */
if (TUNER_ABSENT != dev->tuner_type)
request_module("tuner");
if (card_is_empress(dev)) {
request_module("saa6752hs");
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/video/tvp5150.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ static int tvp5150_set_vbi(struct i2c_client *c,
if (std == V4L2_STD_ALL) {
tvp5150_err("VBI can't be configured without knowing number of lines\n");
return 0;
} else if (std && V4L2_STD_625_50) {
} else if (std & V4L2_STD_625_50) {
/* Don't follow NTSC Line number convension */
line += 3;
}
Expand Down Expand Up @@ -719,7 +719,7 @@ static int tvp5150_get_vbi(struct i2c_client *c,
if (std == V4L2_STD_ALL) {
tvp5150_err("VBI can't be configured without knowing number of lines\n");
return 0;
} else if (std && V4L2_STD_625_50) {
} else if (std & V4L2_STD_625_50) {
/* Don't follow NTSC Line number convension */
line += 3;
}
Expand Down
9 changes: 5 additions & 4 deletions drivers/media/video/usbvideo/usbvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,17 +1034,18 @@ int usbvideo_RegisterVideoDevice(struct uvd *uvd)
info("%s: iface=%d. endpoint=$%02x paletteBits=$%08lx",
__FUNCTION__, uvd->iface, uvd->video_endp, uvd->paletteBits);
}
if (uvd->dev == NULL) {
err("%s: uvd->dev == NULL", __FUNCTION__);
return -EINVAL;
}
uvd->vdev.dev=&(uvd->dev->dev);
if (video_register_device(&uvd->vdev, VFL_TYPE_GRABBER, video_nr) == -1) {
err("%s: video_register_device failed", __FUNCTION__);
return -EPIPE;
}
if (uvd->debug > 1) {
info("%s: video_register_device() successful", __FUNCTION__);
}
if (uvd->dev == NULL) {
err("%s: uvd->dev == NULL", __FUNCTION__);
return -EINVAL;
}

info("%s on /dev/video%d: canvas=%s videosize=%s",
(uvd->handle != NULL) ? uvd->handle->drvName : "???",
Expand Down
50 changes: 41 additions & 9 deletions drivers/media/video/v4l1-compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
struct video_capability *cap = arg;

cap2 = kzalloc(sizeof(*cap2),GFP_KERNEL);
cap2 = kzalloc(sizeof(*cap2), GFP_KERNEL);
if (!cap2) {
err = -ENOMEM;
break;
}
memset(cap, 0, sizeof(*cap));
memset(&fbuf2, 0, sizeof(fbuf2));

Expand Down Expand Up @@ -426,7 +430,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
struct video_window *win = arg;

fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
memset(win,0,sizeof(*win));

fmt2->type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
Expand Down Expand Up @@ -464,7 +472,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
struct video_window *win = arg;
int err1,err2;

fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
drv(inode, file, VIDIOC_STREAMOFF, &fmt2->type);
err1 = drv(inode, file, VIDIOC_G_FMT, fmt2);
Expand Down Expand Up @@ -586,6 +598,12 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
struct video_picture *pict = arg;

fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}

pict->brightness = get_v4l_control(inode, file,
V4L2_CID_BRIGHTNESS,drv);
pict->hue = get_v4l_control(inode, file,
Expand All @@ -597,7 +615,6 @@ v4l_compat_translate_ioctl(struct inode *inode,
pict->whiteness = get_v4l_control(inode, file,
V4L2_CID_WHITENESS, drv);

fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
err = drv(inode, file, VIDIOC_G_FMT, fmt2);
if (err < 0) {
Expand All @@ -617,6 +634,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
struct video_picture *pict = arg;
int mem_err = 0, ovl_err = 0;

fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
memset(&fbuf2, 0, sizeof(fbuf2));

set_v4l_control(inode, file,
Expand All @@ -636,7 +658,6 @@ v4l_compat_translate_ioctl(struct inode *inode,
* different pixel formats for memory vs overlay.
*/

fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
err = drv(inode, file, VIDIOC_G_FMT, fmt2);
/* If VIDIOC_G_FMT failed, then the driver likely doesn't
Expand Down Expand Up @@ -890,7 +911,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
struct video_mmap *mm = arg;

fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
memset(&buf2,0,sizeof(buf2));

fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
Expand Down Expand Up @@ -986,7 +1011,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
struct vbi_format *fmt = arg;

fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE;

err = drv(inode, file, VIDIOC_G_FMT, fmt2);
Expand Down Expand Up @@ -1018,8 +1047,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
break;
}

fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);

fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE;
fmt2->fmt.vbi.samples_per_line = fmt->samples_per_line;
fmt2->fmt.vbi.sampling_rate = fmt->sampling_rate;
Expand Down

0 comments on commit ba42242

Please sign in to comment.