summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/Makefile3
-rw-r--r--drivers/media/common/saa7146_core.c13
-rw-r--r--drivers/media/common/saa7146_fops.c2
-rw-r--r--drivers/media/dvb/dvb-core/dvb_net.c4
-rw-r--r--drivers/media/dvb/frontends/s5h1409.c2
-rw-r--r--drivers/media/radio/radio-cadet.c6
-rw-r--r--drivers/media/video/adv7170.c2
-rw-r--r--drivers/media/video/adv7175.c2
-rw-r--r--drivers/media/video/bt819.c2
-rw-r--r--drivers/media/video/bt856.c2
-rw-r--r--drivers/media/video/bt8xx/bt832.c12
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c31
-rw-r--r--drivers/media/video/cx23885/cx23885-cards.c6
-rw-r--r--drivers/media/video/cx23885/cx23885-core.c134
-rw-r--r--drivers/media/video/dpc7146.c2
-rw-r--r--drivers/media/video/mt20xx.c2
-rw-r--r--drivers/media/video/mxb.c5
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-ctrl.c4
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-devattr.c39
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c6
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-io.c2
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-ioread.c2
-rw-r--r--drivers/media/video/pwc/pwc-if.c7
-rw-r--r--drivers/media/video/saa7110.c4
-rw-r--r--drivers/media/video/saa7111.c2
-rw-r--r--drivers/media/video/saa7114.c2
-rw-r--r--drivers/media/video/saa7185.c2
-rw-r--r--drivers/media/video/tda9840.c2
-rw-r--r--drivers/media/video/tea6415c.c2
-rw-r--r--drivers/media/video/tea6420.c2
-rw-r--r--drivers/media/video/tvp5150.c4
-rw-r--r--drivers/media/video/v4l2-int-device.c2
-rw-r--r--drivers/media/video/zoran_driver.c2
-rw-r--r--drivers/media/video/zr364xx.c2
34 files changed, 130 insertions, 186 deletions
diff --git a/drivers/media/Makefile b/drivers/media/Makefile
index 8cf91353b56a..7b8bb6949f5e 100644
--- a/drivers/media/Makefile
+++ b/drivers/media/Makefile
@@ -6,3 +6,6 @@ obj-y := common/
obj-y += video/
obj-$(CONFIG_VIDEO_DEV) += radio/
obj-$(CONFIG_DVB_CORE) += dvb/
+ifeq ($(CONFIG_DVB_CORE),)
+ obj-$(CONFIG_VIDEO_TUNER) += dvb/frontends/
+endif
diff --git a/drivers/media/common/saa7146_core.c b/drivers/media/common/saa7146_core.c
index 168a8d3a5e55..7707b8c7394b 100644
--- a/drivers/media/common/saa7146_core.c
+++ b/drivers/media/common/saa7146_core.c
@@ -306,25 +306,22 @@ static irqreturn_t interrupt_hw(int irq, void *dev_id)
return IRQ_NONE;
}
- if( 0 != (dev->ext)) {
- if( 0 != (dev->ext->irq_mask & isr )) {
- if( 0 != dev->ext->irq_func ) {
+ if (dev->ext) {
+ if (dev->ext->irq_mask & isr) {
+ if (dev->ext->irq_func)
dev->ext->irq_func(dev, &isr);
- }
isr &= ~dev->ext->irq_mask;
}
}
if (0 != (isr & (MASK_27))) {
DEB_INT(("irq: RPS0 (0x%08x).\n",isr));
- if( 0 != dev->vv_data && 0 != dev->vv_callback) {
+ if (dev->vv_data && dev->vv_callback)
dev->vv_callback(dev,isr);
- }
isr &= ~MASK_27;
}
if (0 != (isr & (MASK_28))) {
- if( 0 != dev->vv_data && 0 != dev->vv_callback) {
+ if (dev->vv_data && dev->vv_callback)
dev->vv_callback(dev,isr);
- }
isr &= ~MASK_28;
}
if (0 != (isr & (MASK_16|MASK_17))) {
diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c
index f0703d8bc3e8..171afe7da6b6 100644
--- a/drivers/media/common/saa7146_fops.c
+++ b/drivers/media/common/saa7146_fops.c
@@ -272,7 +272,7 @@ static int fops_open(struct inode *inode, struct file *file)
result = 0;
out:
- if( fh != 0 && result != 0 ) {
+ if (fh && result != 0) {
kfree(fh);
file->private_data = NULL;
}
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c
index ed3f8268ed11..4c8b62e2c035 100644
--- a/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/drivers/media/dvb/dvb-core/dvb_net.c
@@ -784,8 +784,8 @@ static int dvb_net_ts_callback(const u8 *buffer1, size_t buffer1_len,
{
struct net_device *dev = feed->priv;
- if (buffer2 != 0)
- printk(KERN_WARNING "buffer2 not 0: %p.\n", buffer2);
+ if (buffer2)
+ printk(KERN_WARNING "buffer2 not NULL: %p.\n", buffer2);
if (buffer1_len > 32768)
printk(KERN_WARNING "length > 32k: %zu.\n", buffer1_len);
/* printk("TS callback: %u bytes, %u TS cells @ %p.\n",
diff --git a/drivers/media/dvb/frontends/s5h1409.c b/drivers/media/dvb/frontends/s5h1409.c
index 819433485d3b..1a4d8319773c 100644
--- a/drivers/media/dvb/frontends/s5h1409.c
+++ b/drivers/media/dvb/frontends/s5h1409.c
@@ -445,7 +445,7 @@ static int s5h1409_set_gpio(struct dvb_frontend* fe, int enable)
s5h1409_readreg(state, 0xe3) | 0x1100);
else
return s5h1409_writereg(state, 0xe3,
- s5h1409_readreg(state, 0xe3) & 0xeeff);
+ s5h1409_readreg(state, 0xe3) & 0xfeff);
}
static int s5h1409_sleep(struct dvb_frontend* fe, int enable)
diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c
index 34e317ced5a3..57b9e3adc8f0 100644
--- a/drivers/media/radio/radio-cadet.c
+++ b/drivers/media/radio/radio-cadet.c
@@ -587,6 +587,8 @@ static struct video_device cadet_radio=
.vidioc_s_input = vidioc_s_input,
};
+#ifdef CONFIG_PNP
+
static struct pnp_device_id cadet_pnp_devices[] = {
/* ADS Cadet AM/FM Radio Card */
{.id = "MSM0c24", .driver_data = 0},
@@ -621,6 +623,10 @@ static struct pnp_driver cadet_pnp_driver = {
.remove = NULL,
};
+#else
+static struct pnp_driver cadet_pnp_driver;
+#endif
+
static int cadet_probe(void)
{
static int iovals[8]={0x330,0x332,0x334,0x336,0x338,0x33a,0x33c,0x33e};
diff --git a/drivers/media/video/adv7170.c b/drivers/media/video/adv7170.c
index cbab53fc6243..fea2e723e34b 100644
--- a/drivers/media/video/adv7170.c
+++ b/drivers/media/video/adv7170.c
@@ -408,7 +408,7 @@ adv7170_detect_client (struct i2c_adapter *adapter,
return 0;
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
- if (client == 0)
+ if (!client)
return -ENOMEM;
client->addr = address;
client->adapter = adapter;
diff --git a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c
index 0d0c554bfdf7..10d4d89623f1 100644
--- a/drivers/media/video/adv7175.c
+++ b/drivers/media/video/adv7175.c
@@ -426,7 +426,7 @@ adv7175_detect_client (struct i2c_adapter *adapter,
return 0;
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
- if (client == 0)
+ if (!client)
return -ENOMEM;
client->addr = address;
client->adapter = adapter;
diff --git a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c
index 12d1b9248be5..e663cc045c41 100644
--- a/drivers/media/video/bt819.c
+++ b/drivers/media/video/bt819.c
@@ -524,7 +524,7 @@ bt819_detect_client (struct i2c_adapter *adapter,
return 0;
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
- if (client == 0)
+ if (!client)
return -ENOMEM;
client->addr = address;
client->adapter = adapter;
diff --git a/drivers/media/video/bt856.c b/drivers/media/video/bt856.c
index e1028a76c042..7dee2e3235ad 100644
--- a/drivers/media/video/bt856.c
+++ b/drivers/media/video/bt856.c
@@ -311,7 +311,7 @@ bt856_detect_client (struct i2c_adapter *adapter,
return 0;
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
- if (client == 0)
+ if (!client)
return -ENOMEM;
client->addr = address;
client->adapter = adapter;
diff --git a/drivers/media/video/bt8xx/bt832.c b/drivers/media/video/bt8xx/bt832.c
index a51876137880..f92f06dec0d0 100644
--- a/drivers/media/video/bt8xx/bt832.c
+++ b/drivers/media/video/bt8xx/bt832.c
@@ -97,6 +97,11 @@ int bt832_init(struct i2c_client *i2c_client_s)
int rc;
buf=kmalloc(65,GFP_KERNEL);
+ if (!buf) {
+ v4l_err(&t->client,
+ "Unable to allocate memory. Detaching.\n");
+ return 0;
+ }
bt832_hexdump(i2c_client_s,buf);
if(buf[0x40] != 0x31) {
@@ -211,7 +216,12 @@ bt832_command(struct i2c_client *client, unsigned int cmd, void *arg)
switch (cmd) {
case BT832_HEXDUMP: {
unsigned char *buf;
- buf=kmalloc(65,GFP_KERNEL);
+ buf = kmalloc(65, GFP_KERNEL);
+ if (!buf) {
+ v4l_err(&t->client,
+ "Unable to allocate memory\n");
+ break;
+ }
bt832_hexdump(&t->client,buf);
kfree(buf);
}
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index a080c149cc6c..fcf8f2d208a8 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -1990,7 +1990,7 @@ static int bttv_g_frequency(struct file *file, void *priv,
if (0 != err)
return err;
- f->type = V4L2_TUNER_ANALOG_TV;
+ f->type = btv->radio_user ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
f->frequency = btv->freq;
return 0;
@@ -2009,7 +2009,8 @@ static int bttv_s_frequency(struct file *file, void *priv,
if (unlikely(f->tuner != 0))
return -EINVAL;
- if (unlikely(f->type != V4L2_TUNER_ANALOG_TV))
+ if (unlikely(f->type != (btv->radio_user
+ ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV)))
return -EINVAL;
mutex_lock(&btv->lock);
btv->freq = f->frequency;
@@ -3415,6 +3416,7 @@ static int radio_open(struct inode *inode, struct file *file)
{
int minor = iminor(inode);
struct bttv *btv = NULL;
+ struct bttv_fh *fh;
unsigned int i;
dprintk("bttv: open minor=%d\n",minor);
@@ -3429,12 +3431,19 @@ static int radio_open(struct inode *inode, struct file *file)
return -ENODEV;
dprintk("bttv%d: open called (radio)\n",btv->c.nr);
+
+ /* allocate per filehandle data */
+ fh = kmalloc(sizeof(*fh), GFP_KERNEL);
+ if (NULL == fh)
+ return -ENOMEM;
+ file->private_data = fh;
+ *fh = btv->init;
+ v4l2_prio_open(&btv->prio, &fh->prio);
+
mutex_lock(&btv->lock);
btv->radio_user++;
- file->private_data = btv;
-
bttv_call_i2c_clients(btv,AUDC_SET_RADIO,NULL);
audio_input(btv,TVAUDIO_INPUT_RADIO);
@@ -3444,7 +3453,8 @@ static int radio_open(struct inode *inode, struct file *file)
static int radio_release(struct inode *inode, struct file *file)
{
- struct bttv *btv = file->private_data;
+ struct bttv_fh *fh = file->private_data;
+ struct bttv *btv = fh->btv;
struct rds_command cmd;
btv->radio_user--;
@@ -3508,8 +3518,12 @@ static int radio_enum_input(struct file *file, void *priv,
static int radio_g_audio(struct file *file, void *priv,
struct v4l2_audio *a)
{
+ if (a->index != 0)
+ return -EINVAL;
+
memset(a, 0, sizeof(*a));
strcpy(a->name, "Radio");
+
return 0;
}
@@ -3569,7 +3583,8 @@ static int radio_g_input(struct file *filp, void *priv, unsigned int *i)
static ssize_t radio_read(struct file *file, char __user *data,
size_t count, loff_t *ppos)
{
- struct bttv *btv = file->private_data;
+ struct bttv_fh *fh = file->private_data;
+ struct bttv *btv = fh->btv;
struct rds_command cmd;
cmd.block_count = count/3;
cmd.buffer = data;
@@ -3583,7 +3598,8 @@ static ssize_t radio_read(struct file *file, char __user *data,
static unsigned int radio_poll(struct file *file, poll_table *wait)
{
- struct bttv *btv = file->private_data;
+ struct bttv_fh *fh = file->private_data;
+ struct bttv *btv = fh->btv;
struct rds_command cmd;
cmd.instance = file;
cmd.event_list = wait;
@@ -3599,6 +3615,7 @@ static const struct file_operations radio_fops =
.open = radio_open,
.read = radio_read,
.release = radio_release,
+ .compat_ioctl = v4l_compat_ioctl32,
.ioctl = video_ioctl2,
.llseek = no_llseek,
.poll = radio_poll,
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c
index 2d414dad5c31..dfa269838e01 100644
--- a/drivers/media/video/cx23885/cx23885-cards.c
+++ b/drivers/media/video/cx23885/cx23885-cards.c
@@ -232,6 +232,7 @@ static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data)
case 78631: /* WinTV-HVR1800 (PCIe, OEM, No IR, No FM, Dual channel ATSC and MPEG2 HW Encoder */
case 79001: /* WinTV-HVR1250 (PCIe, Retail, IR, full height, ATSC and Basic analog */
case 79101: /* WinTV-HVR1250 (PCIe, Retail, IR, half height, ATSC and Basic analog */
+ case 79561: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */
case 79571: /* WinTV-HVR1250 (PCIe, OEM, No IR, full height, ATSC and Basic analog */
case 79671: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */
break;
@@ -347,10 +348,13 @@ void cx23885_card_setup(struct cx23885_dev *dev)
case CX23885_BOARD_HAUPPAUGE_HVR1250:
case CX23885_BOARD_HAUPPAUGE_HVR1500:
case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
+ if (dev->i2c_bus[0].i2c_rc == 0)
+ hauppauge_eeprom(dev, eeprom+0x80);
+ break;
case CX23885_BOARD_HAUPPAUGE_HVR1800:
case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
if (dev->i2c_bus[0].i2c_rc == 0)
- hauppauge_eeprom(dev, eeprom+0x80);
+ hauppauge_eeprom(dev, eeprom+0xc0);
break;
}
diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c
index 8e40c7bcc06d..7f10b273598f 100644
--- a/drivers/media/video/cx23885/cx23885-core.c
+++ b/drivers/media/video/cx23885/cx23885-core.c
@@ -56,137 +56,6 @@ LIST_HEAD(cx23885_devlist);
#define NO_SYNC_LINE (-1U)
-/*
- * CX23885 Assumptions
- * 1 line = 16 bytes of CDT
- * cmds size = 80
- * cdt size = 16 * linesize
- * iqsize = 64
- * maxlines = 6
- *
- * Address Space:
- * 0x00000000 0x00008fff FIFO clusters
- * 0x00010000 0x000104af Channel Management Data Structures
- * 0x000104b0 0x000104ff Free
- * 0x00010500 0x000108bf 15 channels * iqsize
- * 0x000108c0 0x000108ff Free
- * 0x00010900 0x00010e9f IQ's + Cluster Descriptor Tables
- * 15 channels * (iqsize + (maxlines * linesize))
- * 0x00010ea0 0x00010xxx Free
- */
-
-static struct sram_channel cx23885_sram_channels[] = {
- [SRAM_CH01] = {
- .name = "VID A",
- .cmds_start = 0x10000,
- .ctrl_start = 0x105b0,
- .cdt = 0x107b0,
- .fifo_start = 0x40,
- .fifo_size = 0x2800,
- .ptr1_reg = DMA1_PTR1,
- .ptr2_reg = DMA1_PTR2,
- .cnt1_reg = DMA1_CNT1,
- .cnt2_reg = DMA1_CNT2,
- .jumponly = 1,
- },
- [SRAM_CH02] = {
- .name = "ch2",
- .cmds_start = 0x0,
- .ctrl_start = 0x0,
- .cdt = 0x0,
- .fifo_start = 0x0,
- .fifo_size = 0x0,
- .ptr1_reg = DMA2_PTR1,
- .ptr2_reg = DMA2_PTR2,
- .cnt1_reg = DMA2_CNT1,
- .cnt2_reg = DMA2_CNT2,
- },
- [SRAM_CH03] = {
- .name = "TS1 B",
- .cmds_start = 0x100A0,
- .ctrl_start = 0x10630,
- .cdt = 0x10870,
- .fifo_start = 0x5000,
- .fifo_size = 0x1000,
- .ptr1_reg = DMA3_PTR1,
- .ptr2_reg = DMA3_PTR2,
- .cnt1_reg = DMA3_CNT1,
- .cnt2_reg = DMA3_CNT2,
- },
- [SRAM_CH04] = {
- .name = "ch4",
- .cmds_start = 0x0,
- .ctrl_start = 0x0,
- .cdt = 0x0,
- .fifo_start = 0x0,
- .fifo_size = 0x0,
- .ptr1_reg = DMA4_PTR1,
- .ptr2_reg = DMA4_PTR2,
- .cnt1_reg = DMA4_CNT1,
- .cnt2_reg = DMA4_CNT2,
- },
- [SRAM_CH05] = {
- .name = "ch5",
- .cmds_start = 0x0,
- .ctrl_start = 0x0,
- .cdt = 0x0,
- .fifo_start = 0x0,
- .fifo_size = 0x0,
- .ptr1_reg = DMA5_PTR1,
- .ptr2_reg = DMA5_PTR2,
- .cnt1_reg = DMA5_CNT1,
- .cnt2_reg = DMA5_CNT2,
- },
- [SRAM_CH06] = {
- .name = "TS2 C",
- .cmds_start = 0x10140,
- .ctrl_start = 0x10680,
- .cdt = 0x108d0,
- .fifo_start = 0x6000,
- .fifo_size = 0x1000,
- .ptr1_reg = DMA5_PTR1,
- .ptr2_reg = DMA5_PTR2,
- .cnt1_reg = DMA5_CNT1,
- .cnt2_reg = DMA5_CNT2,
- },
- [SRAM_CH07] = {
- .name = "ch7",
- .cmds_start = 0x0,
- .ctrl_start = 0x0,
- .cdt = 0x0,
- .fifo_start = 0x0,
- .fifo_size = 0x0,
- .ptr1_reg = DMA6_PTR1,
- .ptr2_reg = DMA6_PTR2,
- .cnt1_reg = DMA6_CNT1,
- .cnt2_reg = DMA6_CNT2,
- },
- [SRAM_CH08] = {
- .name = "ch8",
- .cmds_start = 0x0,
- .ctrl_start = 0x0,
- .cdt = 0x0,
- .fifo_start = 0x0,
- .fifo_size = 0x0,
- .ptr1_reg = DMA7_PTR1,
- .ptr2_reg = DMA7_PTR2,
- .cnt1_reg = DMA7_CNT1,
- .cnt2_reg = DMA7_CNT2,
- },
- [SRAM_CH09] = {
- .name = "ch9",
- .cmds_start = 0x0,
- .ctrl_start = 0x0,
- .cdt = 0x0,
- .fifo_start = 0x0,
- .fifo_size = 0x0,
- .ptr1_reg = DMA8_PTR1,
- .ptr2_reg = DMA8_PTR2,
- .cnt1_reg = DMA8_CNT1,
- .cnt2_reg = DMA8_CNT2,
- },
-};
-
/* FIXME, these allocations will change when
* analog arrives. The be reviewed.
* CX23887 Assumptions
@@ -754,6 +623,7 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
atomic_inc(&dev->refcount);
dev->nr = cx23885_devcount++;
+ dev->sram_channels = cx23887_sram_channels;
sprintf(dev->name, "cx23885[%d]", dev->nr);
mutex_lock(&devlist);
@@ -763,13 +633,11 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
/* Configure the internal memory */
if(dev->pci->device == 0x8880) {
dev->bridge = CX23885_BRIDGE_887;
- dev->sram_channels = cx23887_sram_channels;
/* Apply a sensible clock frequency for the PCIe bridge */
dev->clk_freq = 25000000;
} else
if(dev->pci->device == 0x8852) {
dev->bridge = CX23885_BRIDGE_885;
- dev->sram_channels = cx23885_sram_channels;
/* Apply a sensible clock frequency for the PCIe bridge */
dev->clk_freq = 28000000;
} else
diff --git a/drivers/media/video/dpc7146.c b/drivers/media/video/dpc7146.c
index 566e479e2629..9ceb6b2f3949 100644
--- a/drivers/media/video/dpc7146.c
+++ b/drivers/media/video/dpc7146.c
@@ -131,7 +131,7 @@ static int dpc_probe(struct saa7146_dev* dev)
device_for_each_child(&dpc->i2c_adapter.dev, dpc, dpc_check_clients);
/* check if all devices are present */
- if( 0 == dpc->saa7111a ) {
+ if (!dpc->saa7111a) {
DEB_D(("dpc_v4l2.o: dpc_attach failed for this device.\n"));
i2c_del_adapter(&dpc->i2c_adapter);
kfree(dpc);
diff --git a/drivers/media/video/mt20xx.c b/drivers/media/video/mt20xx.c
index 58bab653330f..74fd6a01d4c4 100644
--- a/drivers/media/video/mt20xx.c
+++ b/drivers/media/video/mt20xx.c
@@ -647,7 +647,7 @@ struct dvb_frontend *microtune_attach(struct dvb_frontend *fe,
default:
tuner_info("microtune %s found, not (yet?) supported, sorry :-/\n",
name);
- return 0;
+ return NULL;
}
strlcpy(fe->ops.tuner_ops.info.name, name,
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c
index add6d0d680be..cb5a510f9251 100644
--- a/drivers/media/video/mxb.c
+++ b/drivers/media/video/mxb.c
@@ -221,9 +221,8 @@ static int mxb_probe(struct saa7146_dev* dev)
device_for_each_child(&mxb->i2c_adapter.dev, mxb, mxb_check_clients);
/* check if all devices are present */
- if( 0 == mxb->tea6420_1 || 0 == mxb->tea6420_2 || 0 == mxb->tea6415c
- || 0 == mxb->tda9840 || 0 == mxb->saa7111a || 0 == mxb->tuner ) {
-
+ if (!mxb->tea6420_1 || !mxb->tea6420_2 || !mxb->tea6415c ||
+ !mxb->tda9840 || !mxb->saa7111a || !mxb->tuner) {
printk("mxb: did not find all i2c devices. aborting\n");
i2c_del_adapter(&mxb->i2c_adapter);
kfree(mxb);
diff --git a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c
index 46f156fb108c..5a3e8d21a38a 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c
@@ -60,7 +60,7 @@ int pvr2_ctrl_set_mask_value(struct pvr2_ctrl *cptr,int mask,int val)
int ret = 0;
if (!cptr) return -EINVAL;
LOCK_TAKE(cptr->hdw->big_lock); do {
- if (cptr->info->set_value != 0) {
+ if (cptr->info->set_value) {
if (cptr->info->type == pvr2_ctl_bitmask) {
mask &= cptr->info->def.type_bitmask.valid_bits;
} else if (cptr->info->type == pvr2_ctl_int) {
@@ -265,7 +265,7 @@ unsigned int pvr2_ctrl_get_v4lflags(struct pvr2_ctrl *cptr)
int pvr2_ctrl_is_writable(struct pvr2_ctrl *cptr)
{
if (!cptr) return 0;
- return cptr->info->set_value != 0;
+ return cptr->info->set_value != NULL;
}
diff --git a/drivers/media/video/pvrusb2/pvrusb2-devattr.c b/drivers/media/video/pvrusb2/pvrusb2-devattr.c
index 4df6d6d936fc..fe9991c10cf4 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-devattr.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-devattr.c
@@ -155,6 +155,41 @@ static const struct pvr2_device_desc pvr2_device_onair_usb2 = {
/*------------------------------------------------------------------------*/
+/* Hauppauge PVR-USB2 Model 73xxx */
+
+static const char *pvr2_client_73xxx[] = {
+ "cx25840",
+ "tuner",
+};
+
+static const char *pvr2_fw1_names_73xxx[] = {
+ "v4l-pvrusb2-73xxx-01.fw",
+};
+
+static const struct pvr2_device_desc pvr2_device_73xxx = {
+ .description = "WinTV PVR USB2 Model Category 73xxxx",
+ .shortname = "73xxx",
+ .client_modules.lst = pvr2_client_73xxx,
+ .client_modules.cnt = ARRAY_SIZE(pvr2_client_73xxx),
+ .fx2_firmware.lst = pvr2_fw1_names_73xxx,
+ .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_73xxx),
+ .flag_has_cx25840 = !0,
+ .flag_has_hauppauge_rom = !0,
+#if 0
+ .flag_has_analogtuner = !0,
+ .flag_has_composite = !0,
+ .flag_has_svideo = !0,
+ .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
+ .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
+ .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
+#else
+ .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
+#endif
+};
+
+
+
+/*------------------------------------------------------------------------*/
/* Hauppauge PVR-USB2 Model 75xxx */
static const char *pvr2_client_75xxx[] = {
@@ -198,8 +233,12 @@ struct usb_device_id pvr2_device_table[] = {
{ USB_DEVICE(0x11ba, 0x1001),
.driver_info = (kernel_ulong_t)&pvr2_device_onair_usb2},
#endif
+ { USB_DEVICE(0x2040, 0x7300),
+ .driver_info = (kernel_ulong_t)&pvr2_device_73xxx},
{ USB_DEVICE(0x2040, 0x7500),
.driver_info = (kernel_ulong_t)&pvr2_device_75xxx},
+ { USB_DEVICE(0x2040, 0x7501),
+ .driver_info = (kernel_ulong_t)&pvr2_device_75xxx},
{ }
};
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 41ae980405ed..d6955fa39598 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -2291,7 +2291,7 @@ static int pvr2_hdw_commit_setup(struct pvr2_hdw *hdw)
for (idx = 0; idx < hdw->control_cnt; idx++) {
cptr = hdw->controls + idx;
- if (cptr->info->is_dirty == 0) continue;
+ if (!cptr->info->is_dirty) continue;
if (!cptr->info->is_dirty(cptr)) continue;
commit_flag = !0;
@@ -2646,7 +2646,7 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw,
u16 address;
unsigned int pipe;
LOCK_TAKE(hdw->big_lock); do {
- if ((hdw->fw_buffer == 0) == !enable_flag) break;
+ if ((hdw->fw_buffer == NULL) == !enable_flag) break;
if (!enable_flag) {
pvr2_trace(PVR2_TRACE_FIRMWARE,
@@ -2715,7 +2715,7 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw,
/* Return true if we're in a mode for retrieval CPU firmware */
int pvr2_hdw_cpufw_get_enabled(struct pvr2_hdw *hdw)
{
- return hdw->fw_buffer != 0;
+ return hdw->fw_buffer != NULL;
}
diff --git a/drivers/media/video/pvrusb2/pvrusb2-io.c b/drivers/media/video/pvrusb2/pvrusb2-io.c
index ce3c8982ffe0..a9889ff96ecc 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-io.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-io.c
@@ -563,7 +563,7 @@ void pvr2_stream_kill(struct pvr2_stream *sp)
struct pvr2_buffer *bp;
mutex_lock(&sp->mutex); do {
pvr2_stream_internal_flush(sp);
- while ((bp = pvr2_stream_get_ready_buffer(sp)) != 0) {
+ while ((bp = pvr2_stream_get_ready_buffer(sp)) != NULL) {
pvr2_buffer_set_idle(bp);
}
if (sp->buffer_total_count != sp->buffer_target_count) {
diff --git a/drivers/media/video/pvrusb2/pvrusb2-ioread.c b/drivers/media/video/pvrusb2/pvrusb2-ioread.c
index f782418afa45..c572212c9f15 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-ioread.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-ioread.c
@@ -165,7 +165,7 @@ static int pvr2_ioread_start(struct pvr2_ioread *cp)
if (!(cp->stream)) return 0;
pvr2_trace(PVR2_TRACE_START_STOP,
"/*---TRACE_READ---*/ pvr2_ioread_start id=%p",cp);
- while ((bp = pvr2_stream_get_idle_buffer(cp->stream)) != 0) {
+ while ((bp = pvr2_stream_get_idle_buffer(cp->stream)) != NULL) {
stat = pvr2_buffer_queue(bp);
if (stat < 0) {
pvr2_trace(PVR2_TRACE_DATA_FLOW,
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index f991d72fe108..e0a453a6543d 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -915,7 +915,7 @@ static void pwc_iso_stop(struct pwc_device *pdev)
struct urb *urb;
urb = pdev->sbuf[i].urb;
- if (urb != 0) {
+ if (urb) {
PWC_DEBUG_MEMORY("Unlinking URB %p\n", urb);
usb_kill_urb(urb);
}
@@ -931,7 +931,7 @@ static void pwc_iso_free(struct pwc_device *pdev)
struct urb *urb;
urb = pdev->sbuf[i].urb;
- if (urb != 0) {
+ if (urb) {
PWC_DEBUG_MEMORY("Freeing URB\n");
usb_free_urb(urb);
pdev->sbuf[i].urb = NULL;
@@ -1759,8 +1759,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
/* Allocate video_device structure */
pdev->vdev = video_device_alloc();
- if (pdev->vdev == 0)
- {
+ if (!pdev->vdev) {
PWC_ERROR("Err, cannot allocate video_device struture. Failing probe.");
kfree(pdev);
return -ENOMEM;
diff --git a/drivers/media/video/saa7110.c b/drivers/media/video/saa7110.c
index 061134a7ba9f..1df2602cd184 100644
--- a/drivers/media/video/saa7110.c
+++ b/drivers/media/video/saa7110.c
@@ -488,7 +488,7 @@ saa7110_detect_client (struct i2c_adapter *adapter,
return 0;
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
- if (client == 0)
+ if (!client)
return -ENOMEM;
client->addr = address;
client->adapter = adapter;
@@ -496,7 +496,7 @@ saa7110_detect_client (struct i2c_adapter *adapter,
strlcpy(I2C_NAME(client), "saa7110", sizeof(I2C_NAME(client)));
decoder = kzalloc(sizeof(struct saa7110), GFP_KERNEL);
- if (decoder == 0) {
+ if (!decoder) {
kfree(client);
return -ENOMEM;
}
diff --git a/drivers/media/video/saa7111.c b/drivers/media/video/saa7111.c
index 7ae2d646d000..a0772c53bb1f 100644
--- a/drivers/media/video/saa7111.c
+++ b/drivers/media/video/saa7111.c
@@ -502,7 +502,7 @@ saa7111_detect_client (struct i2c_adapter *adapter,
return 0;
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
- if (client == 0)
+ if (!client)
return -ENOMEM;
client->addr = address;
client->adapter = adapter;
diff --git a/drivers/media/video/saa7114.c b/drivers/media/video/saa7114.c
index 677df51de1a9..bf91a4faa706 100644
--- a/drivers/media/video/saa7114.c
+++ b/drivers/media/video/saa7114.c
@@ -841,7 +841,7 @@ saa7114_detect_client (struct i2c_adapter *adapter,
return 0;
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
- if (client == 0)
+ if (!client)
return -ENOMEM;
client->addr = address;
client->adapter = adapter;
diff --git a/drivers/media/video/saa7185.c b/drivers/media/video/saa7185.c
index 66cc92c0ea66..41f70440fd3b 100644
--- a/drivers/media/video/saa7185.c
+++ b/drivers/media/video/saa7185.c
@@ -403,7 +403,7 @@ saa7185_detect_client (struct i2c_adapter *adapter,
return 0;
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
- if (client == 0)
+ if (!client)
return -ENOMEM;
client->addr = address;
client->adapter = adapter;
diff --git a/drivers/media/video/tda9840.c b/drivers/media/video/tda9840.c
index ef494febb5e4..bdca5d278978 100644
--- a/drivers/media/video/tda9840.c
+++ b/drivers/media/video/tda9840.c
@@ -172,7 +172,7 @@ static int detect(struct i2c_adapter *adapter, int address, int kind)
/* allocate memory for client structure */
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
- if (0 == client) {
+ if (!client) {
printk("not enough kernel memory\n");
return -ENOMEM;
}
diff --git a/drivers/media/video/tea6415c.c b/drivers/media/video/tea6415c.c
index 523df0b8cc63..df2fad9f391e 100644
--- a/drivers/media/video/tea6415c.c
+++ b/drivers/media/video/tea6415c.c
@@ -64,7 +64,7 @@ static int detect(struct i2c_adapter *adapter, int address, int kind)
/* allocate memory for client structure */
client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
- if (0 == client) {
+ if (!client) {
return -ENOMEM;
}
diff --git a/drivers/media/video/tea6420.c b/drivers/media/video/tea6420.c
index ca05cd655087..4ff6c63f7237 100644
--- a/drivers/media/video/tea6420.c
+++ b/drivers/media/video/tea6420.c
@@ -101,7 +101,7 @@ static int tea6420_detect(struct i2c_adapter *adapter, int address, int kind)
/* allocate memory for client structure */
client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
- if (0 == client) {
+ if (!client) {
return -ENOMEM;
}
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c
index d28318cb2b8d..b6e24e714a23 100644
--- a/drivers/media/video/tvp5150.c
+++ b/drivers/media/video/tvp5150.c
@@ -1072,12 +1072,12 @@ static int tvp5150_detect_client(struct i2c_adapter *adapter,
return 0;
c = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
- if (c == 0)
+ if (!c)
return -ENOMEM;
memcpy(c, &client_template, sizeof(struct i2c_client));
core = kzalloc(sizeof(struct tvp5150), GFP_KERNEL);
- if (core == 0) {
+ if (!core) {
kfree(c);
return -ENOMEM;
}
diff --git a/drivers/media/video/v4l2-int-device.c b/drivers/media/video/v4l2-int-device.c
index a545dcaf857f..0e4549922f26 100644
--- a/drivers/media/video/v4l2-int-device.c
+++ b/drivers/media/video/v4l2-int-device.c
@@ -156,3 +156,5 @@ int v4l2_int_ioctl_1(struct v4l2_int_device *d, int cmd, void *arg)
find_ioctl(d->u.slave, cmd,
(v4l2_int_ioctl_func *)no_such_ioctl_1))(d, arg);
}
+
+MODULE_LICENSE("GPL");
diff --git a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c
index dd3d7d2c8b0e..fea4946ee713 100644
--- a/drivers/media/video/zoran_driver.c
+++ b/drivers/media/video/zoran_driver.c
@@ -339,7 +339,7 @@ v4l_fbuffer_alloc (struct file *file)
/* Use kmalloc */
mem = kmalloc(fh->v4l_buffers.buffer_size, GFP_KERNEL);
- if (mem == 0) {
+ if (!mem) {
dprintk(1,
KERN_ERR
"%s: v4l_fbuffer_alloc() - kmalloc for V4L buf %d failed\n",
diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c
index 1b44784d0efb..04949c823654 100644
--- a/drivers/media/video/zr364xx.c
+++ b/drivers/media/video/zr364xx.c
@@ -390,7 +390,7 @@ static int read_frame(struct zr364xx_camera *cam, int framenum)
}
-static ssize_t zr364xx_read(struct file *file, char *buf, size_t cnt,
+static ssize_t zr364xx_read(struct file *file, char __user *buf, size_t cnt,
loff_t * ppos)
{
unsigned long count = cnt;