diff options
Diffstat (limited to 'drivers/media')
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/ | |||
6 | obj-y += video/ | 6 | obj-y += video/ |
7 | obj-$(CONFIG_VIDEO_DEV) += radio/ | 7 | obj-$(CONFIG_VIDEO_DEV) += radio/ |
8 | obj-$(CONFIG_DVB_CORE) += dvb/ | 8 | obj-$(CONFIG_DVB_CORE) += dvb/ |
9 | ifeq ($(CONFIG_DVB_CORE),) | ||
10 | obj-$(CONFIG_VIDEO_TUNER) += dvb/frontends/ | ||
11 | 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) | |||
306 | return IRQ_NONE; | 306 | return IRQ_NONE; |
307 | } | 307 | } |
308 | 308 | ||
309 | if( 0 != (dev->ext)) { | 309 | if (dev->ext) { |
310 | if( 0 != (dev->ext->irq_mask & isr )) { | 310 | if (dev->ext->irq_mask & isr) { |
311 | if( 0 != dev->ext->irq_func ) { | 311 | if (dev->ext->irq_func) |
312 | dev->ext->irq_func(dev, &isr); | 312 | dev->ext->irq_func(dev, &isr); |
313 | } | ||
314 | isr &= ~dev->ext->irq_mask; | 313 | isr &= ~dev->ext->irq_mask; |
315 | } | 314 | } |
316 | } | 315 | } |
317 | if (0 != (isr & (MASK_27))) { | 316 | if (0 != (isr & (MASK_27))) { |
318 | DEB_INT(("irq: RPS0 (0x%08x).\n",isr)); | 317 | DEB_INT(("irq: RPS0 (0x%08x).\n",isr)); |
319 | if( 0 != dev->vv_data && 0 != dev->vv_callback) { | 318 | if (dev->vv_data && dev->vv_callback) |
320 | dev->vv_callback(dev,isr); | 319 | dev->vv_callback(dev,isr); |
321 | } | ||
322 | isr &= ~MASK_27; | 320 | isr &= ~MASK_27; |
323 | } | 321 | } |
324 | if (0 != (isr & (MASK_28))) { | 322 | if (0 != (isr & (MASK_28))) { |
325 | if( 0 != dev->vv_data && 0 != dev->vv_callback) { | 323 | if (dev->vv_data && dev->vv_callback) |
326 | dev->vv_callback(dev,isr); | 324 | dev->vv_callback(dev,isr); |
327 | } | ||
328 | isr &= ~MASK_28; | 325 | isr &= ~MASK_28; |
329 | } | 326 | } |
330 | if (0 != (isr & (MASK_16|MASK_17))) { | 327 | 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) | |||
272 | 272 | ||
273 | result = 0; | 273 | result = 0; |
274 | out: | 274 | out: |
275 | if( fh != 0 && result != 0 ) { | 275 | if (fh && result != 0) { |
276 | kfree(fh); | 276 | kfree(fh); |
277 | file->private_data = NULL; | 277 | file->private_data = NULL; |
278 | } | 278 | } |
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, | |||
784 | { | 784 | { |
785 | struct net_device *dev = feed->priv; | 785 | struct net_device *dev = feed->priv; |
786 | 786 | ||
787 | if (buffer2 != 0) | 787 | if (buffer2) |
788 | printk(KERN_WARNING "buffer2 not 0: %p.\n", buffer2); | 788 | printk(KERN_WARNING "buffer2 not NULL: %p.\n", buffer2); |
789 | if (buffer1_len > 32768) | 789 | if (buffer1_len > 32768) |
790 | printk(KERN_WARNING "length > 32k: %zu.\n", buffer1_len); | 790 | printk(KERN_WARNING "length > 32k: %zu.\n", buffer1_len); |
791 | /* printk("TS callback: %u bytes, %u TS cells @ %p.\n", | 791 | /* 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) | |||
445 | s5h1409_readreg(state, 0xe3) | 0x1100); | 445 | s5h1409_readreg(state, 0xe3) | 0x1100); |
446 | else | 446 | else |
447 | return s5h1409_writereg(state, 0xe3, | 447 | return s5h1409_writereg(state, 0xe3, |
448 | s5h1409_readreg(state, 0xe3) & 0xeeff); | 448 | s5h1409_readreg(state, 0xe3) & 0xfeff); |
449 | } | 449 | } |
450 | 450 | ||
451 | static int s5h1409_sleep(struct dvb_frontend* fe, int enable) | 451 | 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= | |||
587 | .vidioc_s_input = vidioc_s_input, | 587 | .vidioc_s_input = vidioc_s_input, |
588 | }; | 588 | }; |
589 | 589 | ||
590 | #ifdef CONFIG_PNP | ||
591 | |||
590 | static struct pnp_device_id cadet_pnp_devices[] = { | 592 | static struct pnp_device_id cadet_pnp_devices[] = { |
591 | /* ADS Cadet AM/FM Radio Card */ | 593 | /* ADS Cadet AM/FM Radio Card */ |
592 | {.id = "MSM0c24", .driver_data = 0}, | 594 | {.id = "MSM0c24", .driver_data = 0}, |
@@ -621,6 +623,10 @@ static struct pnp_driver cadet_pnp_driver = { | |||
621 | .remove = NULL, | 623 | .remove = NULL, |
622 | }; | 624 | }; |
623 | 625 | ||
626 | #else | ||
627 | static struct pnp_driver cadet_pnp_driver; | ||
628 | #endif | ||
629 | |||
624 | static int cadet_probe(void) | 630 | static int cadet_probe(void) |
625 | { | 631 | { |
626 | static int iovals[8]={0x330,0x332,0x334,0x336,0x338,0x33a,0x33c,0x33e}; | 632 | 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, | |||
408 | return 0; | 408 | return 0; |
409 | 409 | ||
410 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); | 410 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
411 | if (client == 0) | 411 | if (!client) |
412 | return -ENOMEM; | 412 | return -ENOMEM; |
413 | client->addr = address; | 413 | client->addr = address; |
414 | client->adapter = adapter; | 414 | 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, | |||
426 | return 0; | 426 | return 0; |
427 | 427 | ||
428 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); | 428 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
429 | if (client == 0) | 429 | if (!client) |
430 | return -ENOMEM; | 430 | return -ENOMEM; |
431 | client->addr = address; | 431 | client->addr = address; |
432 | client->adapter = adapter; | 432 | 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, | |||
524 | return 0; | 524 | return 0; |
525 | 525 | ||
526 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); | 526 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
527 | if (client == 0) | 527 | if (!client) |
528 | return -ENOMEM; | 528 | return -ENOMEM; |
529 | client->addr = address; | 529 | client->addr = address; |
530 | client->adapter = adapter; | 530 | 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, | |||
311 | return 0; | 311 | return 0; |
312 | 312 | ||
313 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); | 313 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
314 | if (client == 0) | 314 | if (!client) |
315 | return -ENOMEM; | 315 | return -ENOMEM; |
316 | client->addr = address; | 316 | client->addr = address; |
317 | client->adapter = adapter; | 317 | 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) | |||
97 | int rc; | 97 | int rc; |
98 | 98 | ||
99 | buf=kmalloc(65,GFP_KERNEL); | 99 | buf=kmalloc(65,GFP_KERNEL); |
100 | if (!buf) { | ||
101 | v4l_err(&t->client, | ||
102 | "Unable to allocate memory. Detaching.\n"); | ||
103 | return 0; | ||
104 | } | ||
100 | bt832_hexdump(i2c_client_s,buf); | 105 | bt832_hexdump(i2c_client_s,buf); |
101 | 106 | ||
102 | if(buf[0x40] != 0x31) { | 107 | if(buf[0x40] != 0x31) { |
@@ -211,7 +216,12 @@ bt832_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
211 | switch (cmd) { | 216 | switch (cmd) { |
212 | case BT832_HEXDUMP: { | 217 | case BT832_HEXDUMP: { |
213 | unsigned char *buf; | 218 | unsigned char *buf; |
214 | buf=kmalloc(65,GFP_KERNEL); | 219 | buf = kmalloc(65, GFP_KERNEL); |
220 | if (!buf) { | ||
221 | v4l_err(&t->client, | ||
222 | "Unable to allocate memory\n"); | ||
223 | break; | ||
224 | } | ||
215 | bt832_hexdump(&t->client,buf); | 225 | bt832_hexdump(&t->client,buf); |
216 | kfree(buf); | 226 | kfree(buf); |
217 | } | 227 | } |
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, | |||
1990 | if (0 != err) | 1990 | if (0 != err) |
1991 | return err; | 1991 | return err; |
1992 | 1992 | ||
1993 | f->type = V4L2_TUNER_ANALOG_TV; | 1993 | f->type = btv->radio_user ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; |
1994 | f->frequency = btv->freq; | 1994 | f->frequency = btv->freq; |
1995 | 1995 | ||
1996 | return 0; | 1996 | return 0; |
@@ -2009,7 +2009,8 @@ static int bttv_s_frequency(struct file *file, void *priv, | |||
2009 | 2009 | ||
2010 | if (unlikely(f->tuner != 0)) | 2010 | if (unlikely(f->tuner != 0)) |
2011 | return -EINVAL; | 2011 | return -EINVAL; |
2012 | if (unlikely(f->type != V4L2_TUNER_ANALOG_TV)) | 2012 | if (unlikely(f->type != (btv->radio_user |
2013 | ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV))) | ||
2013 | return -EINVAL; | 2014 | return -EINVAL; |
2014 | mutex_lock(&btv->lock); | 2015 | mutex_lock(&btv->lock); |
2015 | btv->freq = f->frequency; | 2016 | btv->freq = f->frequency; |
@@ -3415,6 +3416,7 @@ static int radio_open(struct inode *inode, struct file *file) | |||
3415 | { | 3416 | { |
3416 | int minor = iminor(inode); | 3417 | int minor = iminor(inode); |
3417 | struct bttv *btv = NULL; | 3418 | struct bttv *btv = NULL; |
3419 | struct bttv_fh *fh; | ||
3418 | unsigned int i; | 3420 | unsigned int i; |
3419 | 3421 | ||
3420 | dprintk("bttv: open minor=%d\n",minor); | 3422 | dprintk("bttv: open minor=%d\n",minor); |
@@ -3429,12 +3431,19 @@ static int radio_open(struct inode *inode, struct file *file) | |||
3429 | return -ENODEV; | 3431 | return -ENODEV; |
3430 | 3432 | ||
3431 | dprintk("bttv%d: open called (radio)\n",btv->c.nr); | 3433 | dprintk("bttv%d: open called (radio)\n",btv->c.nr); |
3434 | |||
3435 | /* allocate per filehandle data */ | ||
3436 | fh = kmalloc(sizeof(*fh), GFP_KERNEL); | ||
3437 | if (NULL == fh) | ||
3438 | return -ENOMEM; | ||
3439 | file->private_data = fh; | ||
3440 | *fh = btv->init; | ||
3441 | v4l2_prio_open(&btv->prio, &fh->prio); | ||
3442 | |||
3432 | mutex_lock(&btv->lock); | 3443 | mutex_lock(&btv->lock); |
3433 | 3444 | ||
3434 | btv->radio_user++; | 3445 | btv->radio_user++; |
3435 | 3446 | ||
3436 | file->private_data = btv; | ||
3437 | |||
3438 | bttv_call_i2c_clients(btv,AUDC_SET_RADIO,NULL); | 3447 | bttv_call_i2c_clients(btv,AUDC_SET_RADIO,NULL); |
3439 | audio_input(btv,TVAUDIO_INPUT_RADIO); | 3448 | audio_input(btv,TVAUDIO_INPUT_RADIO); |
3440 | 3449 | ||
@@ -3444,7 +3453,8 @@ static int radio_open(struct inode *inode, struct file *file) | |||
3444 | 3453 | ||
3445 | static int radio_release(struct inode *inode, struct file *file) | 3454 | static int radio_release(struct inode *inode, struct file *file) |
3446 | { | 3455 | { |
3447 | struct bttv *btv = file->private_data; | 3456 | struct bttv_fh *fh = file->private_data; |
3457 | struct bttv *btv = fh->btv; | ||
3448 | struct rds_command cmd; | 3458 | struct rds_command cmd; |
3449 | 3459 | ||
3450 | btv->radio_user--; | 3460 | btv->radio_user--; |
@@ -3508,8 +3518,12 @@ static int radio_enum_input(struct file *file, void *priv, | |||
3508 | static int radio_g_audio(struct file *file, void *priv, | 3518 | static int radio_g_audio(struct file *file, void *priv, |
3509 | struct v4l2_audio *a) | 3519 | struct v4l2_audio *a) |
3510 | { | 3520 | { |
3521 | if (a->index != 0) | ||
3522 | return -EINVAL; | ||
3523 | |||
3511 | memset(a, 0, sizeof(*a)); | 3524 | memset(a, 0, sizeof(*a)); |
3512 | strcpy(a->name, "Radio"); | 3525 | strcpy(a->name, "Radio"); |
3526 | |||
3513 | return 0; | 3527 | return 0; |
3514 | } | 3528 | } |
3515 | 3529 | ||
@@ -3569,7 +3583,8 @@ static int radio_g_input(struct file *filp, void *priv, unsigned int *i) | |||
3569 | static ssize_t radio_read(struct file *file, char __user *data, | 3583 | static ssize_t radio_read(struct file *file, char __user *data, |
3570 | size_t count, loff_t *ppos) | 3584 | size_t count, loff_t *ppos) |
3571 | { | 3585 | { |
3572 | struct bttv *btv = file->private_data; | 3586 | struct bttv_fh *fh = file->private_data; |
3587 | struct bttv *btv = fh->btv; | ||
3573 | struct rds_command cmd; | 3588 | struct rds_command cmd; |
3574 | cmd.block_count = count/3; | 3589 | cmd.block_count = count/3; |
3575 | cmd.buffer = data; | 3590 | cmd.buffer = data; |
@@ -3583,7 +3598,8 @@ static ssize_t radio_read(struct file *file, char __user *data, | |||
3583 | 3598 | ||
3584 | static unsigned int radio_poll(struct file *file, poll_table *wait) | 3599 | static unsigned int radio_poll(struct file *file, poll_table *wait) |
3585 | { | 3600 | { |
3586 | struct bttv *btv = file->private_data; | 3601 | struct bttv_fh *fh = file->private_data; |
3602 | struct bttv *btv = fh->btv; | ||
3587 | struct rds_command cmd; | 3603 | struct rds_command cmd; |
3588 | cmd.instance = file; | 3604 | cmd.instance = file; |
3589 | cmd.event_list = wait; | 3605 | cmd.event_list = wait; |
@@ -3599,6 +3615,7 @@ static const struct file_operations radio_fops = | |||
3599 | .open = radio_open, | 3615 | .open = radio_open, |
3600 | .read = radio_read, | 3616 | .read = radio_read, |
3601 | .release = radio_release, | 3617 | .release = radio_release, |
3618 | .compat_ioctl = v4l_compat_ioctl32, | ||
3602 | .ioctl = video_ioctl2, | 3619 | .ioctl = video_ioctl2, |
3603 | .llseek = no_llseek, | 3620 | .llseek = no_llseek, |
3604 | .poll = radio_poll, | 3621 | .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) | |||
232 | case 78631: /* WinTV-HVR1800 (PCIe, OEM, No IR, No FM, Dual channel ATSC and MPEG2 HW Encoder */ | 232 | case 78631: /* WinTV-HVR1800 (PCIe, OEM, No IR, No FM, Dual channel ATSC and MPEG2 HW Encoder */ |
233 | case 79001: /* WinTV-HVR1250 (PCIe, Retail, IR, full height, ATSC and Basic analog */ | 233 | case 79001: /* WinTV-HVR1250 (PCIe, Retail, IR, full height, ATSC and Basic analog */ |
234 | case 79101: /* WinTV-HVR1250 (PCIe, Retail, IR, half height, ATSC and Basic analog */ | 234 | case 79101: /* WinTV-HVR1250 (PCIe, Retail, IR, half height, ATSC and Basic analog */ |
235 | case 79561: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */ | ||
235 | case 79571: /* WinTV-HVR1250 (PCIe, OEM, No IR, full height, ATSC and Basic analog */ | 236 | case 79571: /* WinTV-HVR1250 (PCIe, OEM, No IR, full height, ATSC and Basic analog */ |
236 | case 79671: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */ | 237 | case 79671: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */ |
237 | break; | 238 | break; |
@@ -347,10 +348,13 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
347 | case CX23885_BOARD_HAUPPAUGE_HVR1250: | 348 | case CX23885_BOARD_HAUPPAUGE_HVR1250: |
348 | case CX23885_BOARD_HAUPPAUGE_HVR1500: | 349 | case CX23885_BOARD_HAUPPAUGE_HVR1500: |
349 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: | 350 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: |
351 | if (dev->i2c_bus[0].i2c_rc == 0) | ||
352 | hauppauge_eeprom(dev, eeprom+0x80); | ||
353 | break; | ||
350 | case CX23885_BOARD_HAUPPAUGE_HVR1800: | 354 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
351 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: | 355 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: |
352 | if (dev->i2c_bus[0].i2c_rc == 0) | 356 | if (dev->i2c_bus[0].i2c_rc == 0) |
353 | hauppauge_eeprom(dev, eeprom+0x80); | 357 | hauppauge_eeprom(dev, eeprom+0xc0); |
354 | break; | 358 | break; |
355 | } | 359 | } |
356 | 360 | ||
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); | |||
56 | 56 | ||
57 | #define NO_SYNC_LINE (-1U) | 57 | #define NO_SYNC_LINE (-1U) |
58 | 58 | ||
59 | /* | ||
60 | * CX23885 Assumptions | ||
61 | * 1 line = 16 bytes of CDT | ||
62 | * cmds size = 80 | ||
63 | * cdt size = 16 * linesize | ||
64 | * iqsize = 64 | ||
65 | * maxlines = 6 | ||
66 | * | ||
67 | * Address Space: | ||
68 | * 0x00000000 0x00008fff FIFO clusters | ||
69 | * 0x00010000 0x000104af Channel Management Data Structures | ||
70 | * 0x000104b0 0x000104ff Free | ||
71 | * 0x00010500 0x000108bf 15 channels * iqsize | ||
72 | * 0x000108c0 0x000108ff Free | ||
73 | * 0x00010900 0x00010e9f IQ's + Cluster Descriptor Tables | ||
74 | * 15 channels * (iqsize + (maxlines * linesize)) | ||
75 | * 0x00010ea0 0x00010xxx Free | ||
76 | */ | ||
77 | |||
78 | static struct sram_channel cx23885_sram_channels[] = { | ||
79 | [SRAM_CH01] = { | ||
80 | .name = "VID A", | ||
81 | .cmds_start = 0x10000, | ||
82 | .ctrl_start = 0x105b0, | ||
83 | .cdt = 0x107b0, | ||
84 | .fifo_start = 0x40, | ||
85 | .fifo_size = 0x2800, | ||
86 | .ptr1_reg = DMA1_PTR1, | ||
87 | .ptr2_reg = DMA1_PTR2, | ||
88 | .cnt1_reg = DMA1_CNT1, | ||
89 | .cnt2_reg = DMA1_CNT2, | ||
90 | .jumponly = 1, | ||
91 | }, | ||
92 | [SRAM_CH02] = { | ||
93 | .name = "ch2", | ||
94 | .cmds_start = 0x0, | ||
95 | .ctrl_start = 0x0, | ||
96 | .cdt = 0x0, | ||
97 | .fifo_start = 0x0, | ||
98 | .fifo_size = 0x0, | ||
99 | .ptr1_reg = DMA2_PTR1, | ||
100 | .ptr2_reg = DMA2_PTR2, | ||
101 | .cnt1_reg = DMA2_CNT1, | ||
102 | .cnt2_reg = DMA2_CNT2, | ||
103 | }, | ||
104 | [SRAM_CH03] = { | ||
105 | .name = "TS1 B", | ||
106 | .cmds_start = 0x100A0, | ||
107 | .ctrl_start = 0x10630, | ||
108 | .cdt = 0x10870, | ||
109 | .fifo_start = 0x5000, | ||
110 | .fifo_size = 0x1000, | ||
111 | .ptr1_reg = DMA3_PTR1, | ||
112 | .ptr2_reg = DMA3_PTR2, | ||
113 | .cnt1_reg = DMA3_CNT1, | ||
114 | .cnt2_reg = DMA3_CNT2, | ||
115 | }, | ||
116 | [SRAM_CH04] = { | ||
117 | .name = "ch4", | ||
118 | .cmds_start = 0x0, | ||
119 | .ctrl_start = 0x0, | ||
120 | .cdt = 0x0, | ||
121 | .fifo_start = 0x0, | ||
122 | .fifo_size = 0x0, | ||
123 | .ptr1_reg = DMA4_PTR1, | ||
124 | .ptr2_reg = DMA4_PTR2, | ||
125 | .cnt1_reg = DMA4_CNT1, | ||
126 | .cnt2_reg = DMA4_CNT2, | ||
127 | }, | ||
128 | [SRAM_CH05] = { | ||
129 | .name = "ch5", | ||
130 | .cmds_start = 0x0, | ||
131 | .ctrl_start = 0x0, | ||
132 | .cdt = 0x0, | ||
133 | .fifo_start = 0x0, | ||
134 | .fifo_size = 0x0, | ||
135 | .ptr1_reg = DMA5_PTR1, | ||
136 | .ptr2_reg = DMA5_PTR2, | ||
137 | .cnt1_reg = DMA5_CNT1, | ||
138 | .cnt2_reg = DMA5_CNT2, | ||
139 | }, | ||
140 | [SRAM_CH06] = { | ||
141 | .name = "TS2 C", | ||
142 | .cmds_start = 0x10140, | ||
143 | .ctrl_start = 0x10680, | ||
144 | .cdt = 0x108d0, | ||
145 | .fifo_start = 0x6000, | ||
146 | .fifo_size = 0x1000, | ||
147 | .ptr1_reg = DMA5_PTR1, | ||
148 | .ptr2_reg = DMA5_PTR2, | ||
149 | .cnt1_reg = DMA5_CNT1, | ||
150 | .cnt2_reg = DMA5_CNT2, | ||
151 | }, | ||
152 | [SRAM_CH07] = { | ||
153 | .name = "ch7", | ||
154 | .cmds_start = 0x0, | ||
155 | .ctrl_start = 0x0, | ||
156 | .cdt = 0x0, | ||
157 | .fifo_start = 0x0, | ||
158 | .fifo_size = 0x0, | ||
159 | .ptr1_reg = DMA6_PTR1, | ||
160 | .ptr2_reg = DMA6_PTR2, | ||
161 | .cnt1_reg = DMA6_CNT1, | ||
162 | .cnt2_reg = DMA6_CNT2, | ||
163 | }, | ||
164 | [SRAM_CH08] = { | ||
165 | .name = "ch8", | ||
166 | .cmds_start = 0x0, | ||
167 | .ctrl_start = 0x0, | ||
168 | .cdt = 0x0, | ||
169 | .fifo_start = 0x0, | ||
170 | .fifo_size = 0x0, | ||
171 | .ptr1_reg = DMA7_PTR1, | ||
172 | .ptr2_reg = DMA7_PTR2, | ||
173 | .cnt1_reg = DMA7_CNT1, | ||
174 | .cnt2_reg = DMA7_CNT2, | ||
175 | }, | ||
176 | [SRAM_CH09] = { | ||
177 | .name = "ch9", | ||
178 | .cmds_start = 0x0, | ||
179 | .ctrl_start = 0x0, | ||
180 | .cdt = 0x0, | ||
181 | .fifo_start = 0x0, | ||
182 | .fifo_size = 0x0, | ||
183 | .ptr1_reg = DMA8_PTR1, | ||
184 | .ptr2_reg = DMA8_PTR2, | ||
185 | .cnt1_reg = DMA8_CNT1, | ||
186 | .cnt2_reg = DMA8_CNT2, | ||
187 | }, | ||
188 | }; | ||
189 | |||
190 | /* FIXME, these allocations will change when | 59 | /* FIXME, these allocations will change when |
191 | * analog arrives. The be reviewed. | 60 | * analog arrives. The be reviewed. |
192 | * CX23887 Assumptions | 61 | * CX23887 Assumptions |
@@ -754,6 +623,7 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) | |||
754 | atomic_inc(&dev->refcount); | 623 | atomic_inc(&dev->refcount); |
755 | 624 | ||
756 | dev->nr = cx23885_devcount++; | 625 | dev->nr = cx23885_devcount++; |
626 | dev->sram_channels = cx23887_sram_channels; | ||
757 | sprintf(dev->name, "cx23885[%d]", dev->nr); | 627 | sprintf(dev->name, "cx23885[%d]", dev->nr); |
758 | 628 | ||
759 | mutex_lock(&devlist); | 629 | mutex_lock(&devlist); |
@@ -763,13 +633,11 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) | |||
763 | /* Configure the internal memory */ | 633 | /* Configure the internal memory */ |
764 | if(dev->pci->device == 0x8880) { | 634 | if(dev->pci->device == 0x8880) { |
765 | dev->bridge = CX23885_BRIDGE_887; | 635 | dev->bridge = CX23885_BRIDGE_887; |
766 | dev->sram_channels = cx23887_sram_channels; | ||
767 | /* Apply a sensible clock frequency for the PCIe bridge */ | 636 | /* Apply a sensible clock frequency for the PCIe bridge */ |
768 | dev->clk_freq = 25000000; | 637 | dev->clk_freq = 25000000; |
769 | } else | 638 | } else |
770 | if(dev->pci->device == 0x8852) { | 639 | if(dev->pci->device == 0x8852) { |
771 | dev->bridge = CX23885_BRIDGE_885; | 640 | dev->bridge = CX23885_BRIDGE_885; |
772 | dev->sram_channels = cx23885_sram_channels; | ||
773 | /* Apply a sensible clock frequency for the PCIe bridge */ | 641 | /* Apply a sensible clock frequency for the PCIe bridge */ |
774 | dev->clk_freq = 28000000; | 642 | dev->clk_freq = 28000000; |
775 | } else | 643 | } 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) | |||
131 | device_for_each_child(&dpc->i2c_adapter.dev, dpc, dpc_check_clients); | 131 | device_for_each_child(&dpc->i2c_adapter.dev, dpc, dpc_check_clients); |
132 | 132 | ||
133 | /* check if all devices are present */ | 133 | /* check if all devices are present */ |
134 | if( 0 == dpc->saa7111a ) { | 134 | if (!dpc->saa7111a) { |
135 | DEB_D(("dpc_v4l2.o: dpc_attach failed for this device.\n")); | 135 | DEB_D(("dpc_v4l2.o: dpc_attach failed for this device.\n")); |
136 | i2c_del_adapter(&dpc->i2c_adapter); | 136 | i2c_del_adapter(&dpc->i2c_adapter); |
137 | kfree(dpc); | 137 | 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, | |||
647 | default: | 647 | default: |
648 | tuner_info("microtune %s found, not (yet?) supported, sorry :-/\n", | 648 | tuner_info("microtune %s found, not (yet?) supported, sorry :-/\n", |
649 | name); | 649 | name); |
650 | return 0; | 650 | return NULL; |
651 | } | 651 | } |
652 | 652 | ||
653 | strlcpy(fe->ops.tuner_ops.info.name, name, | 653 | 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) | |||
221 | device_for_each_child(&mxb->i2c_adapter.dev, mxb, mxb_check_clients); | 221 | device_for_each_child(&mxb->i2c_adapter.dev, mxb, mxb_check_clients); |
222 | 222 | ||
223 | /* check if all devices are present */ | 223 | /* check if all devices are present */ |
224 | if( 0 == mxb->tea6420_1 || 0 == mxb->tea6420_2 || 0 == mxb->tea6415c | 224 | if (!mxb->tea6420_1 || !mxb->tea6420_2 || !mxb->tea6415c || |
225 | || 0 == mxb->tda9840 || 0 == mxb->saa7111a || 0 == mxb->tuner ) { | 225 | !mxb->tda9840 || !mxb->saa7111a || !mxb->tuner) { |
226 | |||
227 | printk("mxb: did not find all i2c devices. aborting\n"); | 226 | printk("mxb: did not find all i2c devices. aborting\n"); |
228 | i2c_del_adapter(&mxb->i2c_adapter); | 227 | i2c_del_adapter(&mxb->i2c_adapter); |
229 | kfree(mxb); | 228 | 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) | |||
60 | int ret = 0; | 60 | int ret = 0; |
61 | if (!cptr) return -EINVAL; | 61 | if (!cptr) return -EINVAL; |
62 | LOCK_TAKE(cptr->hdw->big_lock); do { | 62 | LOCK_TAKE(cptr->hdw->big_lock); do { |
63 | if (cptr->info->set_value != 0) { | 63 | if (cptr->info->set_value) { |
64 | if (cptr->info->type == pvr2_ctl_bitmask) { | 64 | if (cptr->info->type == pvr2_ctl_bitmask) { |
65 | mask &= cptr->info->def.type_bitmask.valid_bits; | 65 | mask &= cptr->info->def.type_bitmask.valid_bits; |
66 | } else if (cptr->info->type == pvr2_ctl_int) { | 66 | } else if (cptr->info->type == pvr2_ctl_int) { |
@@ -265,7 +265,7 @@ unsigned int pvr2_ctrl_get_v4lflags(struct pvr2_ctrl *cptr) | |||
265 | int pvr2_ctrl_is_writable(struct pvr2_ctrl *cptr) | 265 | int pvr2_ctrl_is_writable(struct pvr2_ctrl *cptr) |
266 | { | 266 | { |
267 | if (!cptr) return 0; | 267 | if (!cptr) return 0; |
268 | return cptr->info->set_value != 0; | 268 | return cptr->info->set_value != NULL; |
269 | } | 269 | } |
270 | 270 | ||
271 | 271 | ||
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 = { | |||
155 | 155 | ||
156 | 156 | ||
157 | /*------------------------------------------------------------------------*/ | 157 | /*------------------------------------------------------------------------*/ |
158 | /* Hauppauge PVR-USB2 Model 73xxx */ | ||
159 | |||
160 | static const char *pvr2_client_73xxx[] = { | ||
161 | "cx25840", | ||
162 | "tuner", | ||
163 | }; | ||
164 | |||
165 | static const char *pvr2_fw1_names_73xxx[] = { | ||
166 | "v4l-pvrusb2-73xxx-01.fw", | ||
167 | }; | ||
168 | |||
169 | static const struct pvr2_device_desc pvr2_device_73xxx = { | ||
170 | .description = "WinTV PVR USB2 Model Category 73xxxx", | ||
171 | .shortname = "73xxx", | ||
172 | .client_modules.lst = pvr2_client_73xxx, | ||
173 | .client_modules.cnt = ARRAY_SIZE(pvr2_client_73xxx), | ||
174 | .fx2_firmware.lst = pvr2_fw1_names_73xxx, | ||
175 | .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_73xxx), | ||
176 | .flag_has_cx25840 = !0, | ||
177 | .flag_has_hauppauge_rom = !0, | ||
178 | #if 0 | ||
179 | .flag_has_analogtuner = !0, | ||
180 | .flag_has_composite = !0, | ||
181 | .flag_has_svideo = !0, | ||
182 | .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, | ||
183 | .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE, | ||
184 | .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE, | ||
185 | #else | ||
186 | .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, | ||
187 | #endif | ||
188 | }; | ||
189 | |||
190 | |||
191 | |||
192 | /*------------------------------------------------------------------------*/ | ||
158 | /* Hauppauge PVR-USB2 Model 75xxx */ | 193 | /* Hauppauge PVR-USB2 Model 75xxx */ |
159 | 194 | ||
160 | static const char *pvr2_client_75xxx[] = { | 195 | static const char *pvr2_client_75xxx[] = { |
@@ -198,8 +233,12 @@ struct usb_device_id pvr2_device_table[] = { | |||
198 | { USB_DEVICE(0x11ba, 0x1001), | 233 | { USB_DEVICE(0x11ba, 0x1001), |
199 | .driver_info = (kernel_ulong_t)&pvr2_device_onair_usb2}, | 234 | .driver_info = (kernel_ulong_t)&pvr2_device_onair_usb2}, |
200 | #endif | 235 | #endif |
236 | { USB_DEVICE(0x2040, 0x7300), | ||
237 | .driver_info = (kernel_ulong_t)&pvr2_device_73xxx}, | ||
201 | { USB_DEVICE(0x2040, 0x7500), | 238 | { USB_DEVICE(0x2040, 0x7500), |
202 | .driver_info = (kernel_ulong_t)&pvr2_device_75xxx}, | 239 | .driver_info = (kernel_ulong_t)&pvr2_device_75xxx}, |
240 | { USB_DEVICE(0x2040, 0x7501), | ||
241 | .driver_info = (kernel_ulong_t)&pvr2_device_75xxx}, | ||
203 | { } | 242 | { } |
204 | }; | 243 | }; |
205 | 244 | ||
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) | |||
2291 | 2291 | ||
2292 | for (idx = 0; idx < hdw->control_cnt; idx++) { | 2292 | for (idx = 0; idx < hdw->control_cnt; idx++) { |
2293 | cptr = hdw->controls + idx; | 2293 | cptr = hdw->controls + idx; |
2294 | if (cptr->info->is_dirty == 0) continue; | 2294 | if (!cptr->info->is_dirty) continue; |
2295 | if (!cptr->info->is_dirty(cptr)) continue; | 2295 | if (!cptr->info->is_dirty(cptr)) continue; |
2296 | commit_flag = !0; | 2296 | commit_flag = !0; |
2297 | 2297 | ||
@@ -2646,7 +2646,7 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw, | |||
2646 | u16 address; | 2646 | u16 address; |
2647 | unsigned int pipe; | 2647 | unsigned int pipe; |
2648 | LOCK_TAKE(hdw->big_lock); do { | 2648 | LOCK_TAKE(hdw->big_lock); do { |
2649 | if ((hdw->fw_buffer == 0) == !enable_flag) break; | 2649 | if ((hdw->fw_buffer == NULL) == !enable_flag) break; |
2650 | 2650 | ||
2651 | if (!enable_flag) { | 2651 | if (!enable_flag) { |
2652 | pvr2_trace(PVR2_TRACE_FIRMWARE, | 2652 | pvr2_trace(PVR2_TRACE_FIRMWARE, |
@@ -2715,7 +2715,7 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw, | |||
2715 | /* Return true if we're in a mode for retrieval CPU firmware */ | 2715 | /* Return true if we're in a mode for retrieval CPU firmware */ |
2716 | int pvr2_hdw_cpufw_get_enabled(struct pvr2_hdw *hdw) | 2716 | int pvr2_hdw_cpufw_get_enabled(struct pvr2_hdw *hdw) |
2717 | { | 2717 | { |
2718 | return hdw->fw_buffer != 0; | 2718 | return hdw->fw_buffer != NULL; |
2719 | } | 2719 | } |
2720 | 2720 | ||
2721 | 2721 | ||
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) | |||
563 | struct pvr2_buffer *bp; | 563 | struct pvr2_buffer *bp; |
564 | mutex_lock(&sp->mutex); do { | 564 | mutex_lock(&sp->mutex); do { |
565 | pvr2_stream_internal_flush(sp); | 565 | pvr2_stream_internal_flush(sp); |
566 | while ((bp = pvr2_stream_get_ready_buffer(sp)) != 0) { | 566 | while ((bp = pvr2_stream_get_ready_buffer(sp)) != NULL) { |
567 | pvr2_buffer_set_idle(bp); | 567 | pvr2_buffer_set_idle(bp); |
568 | } | 568 | } |
569 | if (sp->buffer_total_count != sp->buffer_target_count) { | 569 | 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) | |||
165 | if (!(cp->stream)) return 0; | 165 | if (!(cp->stream)) return 0; |
166 | pvr2_trace(PVR2_TRACE_START_STOP, | 166 | pvr2_trace(PVR2_TRACE_START_STOP, |
167 | "/*---TRACE_READ---*/ pvr2_ioread_start id=%p",cp); | 167 | "/*---TRACE_READ---*/ pvr2_ioread_start id=%p",cp); |
168 | while ((bp = pvr2_stream_get_idle_buffer(cp->stream)) != 0) { | 168 | while ((bp = pvr2_stream_get_idle_buffer(cp->stream)) != NULL) { |
169 | stat = pvr2_buffer_queue(bp); | 169 | stat = pvr2_buffer_queue(bp); |
170 | if (stat < 0) { | 170 | if (stat < 0) { |
171 | pvr2_trace(PVR2_TRACE_DATA_FLOW, | 171 | 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) | |||
915 | struct urb *urb; | 915 | struct urb *urb; |
916 | 916 | ||
917 | urb = pdev->sbuf[i].urb; | 917 | urb = pdev->sbuf[i].urb; |
918 | if (urb != 0) { | 918 | if (urb) { |
919 | PWC_DEBUG_MEMORY("Unlinking URB %p\n", urb); | 919 | PWC_DEBUG_MEMORY("Unlinking URB %p\n", urb); |
920 | usb_kill_urb(urb); | 920 | usb_kill_urb(urb); |
921 | } | 921 | } |
@@ -931,7 +931,7 @@ static void pwc_iso_free(struct pwc_device *pdev) | |||
931 | struct urb *urb; | 931 | struct urb *urb; |
932 | 932 | ||
933 | urb = pdev->sbuf[i].urb; | 933 | urb = pdev->sbuf[i].urb; |
934 | if (urb != 0) { | 934 | if (urb) { |
935 | PWC_DEBUG_MEMORY("Freeing URB\n"); | 935 | PWC_DEBUG_MEMORY("Freeing URB\n"); |
936 | usb_free_urb(urb); | 936 | usb_free_urb(urb); |
937 | pdev->sbuf[i].urb = NULL; | 937 | pdev->sbuf[i].urb = NULL; |
@@ -1759,8 +1759,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id | |||
1759 | 1759 | ||
1760 | /* Allocate video_device structure */ | 1760 | /* Allocate video_device structure */ |
1761 | pdev->vdev = video_device_alloc(); | 1761 | pdev->vdev = video_device_alloc(); |
1762 | if (pdev->vdev == 0) | 1762 | if (!pdev->vdev) { |
1763 | { | ||
1764 | PWC_ERROR("Err, cannot allocate video_device struture. Failing probe."); | 1763 | PWC_ERROR("Err, cannot allocate video_device struture. Failing probe."); |
1765 | kfree(pdev); | 1764 | kfree(pdev); |
1766 | return -ENOMEM; | 1765 | 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, | |||
488 | return 0; | 488 | return 0; |
489 | 489 | ||
490 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); | 490 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
491 | if (client == 0) | 491 | if (!client) |
492 | return -ENOMEM; | 492 | return -ENOMEM; |
493 | client->addr = address; | 493 | client->addr = address; |
494 | client->adapter = adapter; | 494 | client->adapter = adapter; |
@@ -496,7 +496,7 @@ saa7110_detect_client (struct i2c_adapter *adapter, | |||
496 | strlcpy(I2C_NAME(client), "saa7110", sizeof(I2C_NAME(client))); | 496 | strlcpy(I2C_NAME(client), "saa7110", sizeof(I2C_NAME(client))); |
497 | 497 | ||
498 | decoder = kzalloc(sizeof(struct saa7110), GFP_KERNEL); | 498 | decoder = kzalloc(sizeof(struct saa7110), GFP_KERNEL); |
499 | if (decoder == 0) { | 499 | if (!decoder) { |
500 | kfree(client); | 500 | kfree(client); |
501 | return -ENOMEM; | 501 | return -ENOMEM; |
502 | } | 502 | } |
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, | |||
502 | return 0; | 502 | return 0; |
503 | 503 | ||
504 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); | 504 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
505 | if (client == 0) | 505 | if (!client) |
506 | return -ENOMEM; | 506 | return -ENOMEM; |
507 | client->addr = address; | 507 | client->addr = address; |
508 | client->adapter = adapter; | 508 | 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, | |||
841 | return 0; | 841 | return 0; |
842 | 842 | ||
843 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); | 843 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
844 | if (client == 0) | 844 | if (!client) |
845 | return -ENOMEM; | 845 | return -ENOMEM; |
846 | client->addr = address; | 846 | client->addr = address; |
847 | client->adapter = adapter; | 847 | 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, | |||
403 | return 0; | 403 | return 0; |
404 | 404 | ||
405 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); | 405 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
406 | if (client == 0) | 406 | if (!client) |
407 | return -ENOMEM; | 407 | return -ENOMEM; |
408 | client->addr = address; | 408 | client->addr = address; |
409 | client->adapter = adapter; | 409 | 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) | |||
172 | 172 | ||
173 | /* allocate memory for client structure */ | 173 | /* allocate memory for client structure */ |
174 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 174 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); |
175 | if (0 == client) { | 175 | if (!client) { |
176 | printk("not enough kernel memory\n"); | 176 | printk("not enough kernel memory\n"); |
177 | return -ENOMEM; | 177 | return -ENOMEM; |
178 | } | 178 | } |
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) | |||
64 | 64 | ||
65 | /* allocate memory for client structure */ | 65 | /* allocate memory for client structure */ |
66 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 66 | client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); |
67 | if (0 == client) { | 67 | if (!client) { |
68 | return -ENOMEM; | 68 | return -ENOMEM; |
69 | } | 69 | } |
70 | 70 | ||
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) | |||
101 | 101 | ||
102 | /* allocate memory for client structure */ | 102 | /* allocate memory for client structure */ |
103 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); | 103 | client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); |
104 | if (0 == client) { | 104 | if (!client) { |
105 | return -ENOMEM; | 105 | return -ENOMEM; |
106 | } | 106 | } |
107 | 107 | ||
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, | |||
1072 | return 0; | 1072 | return 0; |
1073 | 1073 | ||
1074 | c = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); | 1074 | c = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); |
1075 | if (c == 0) | 1075 | if (!c) |
1076 | return -ENOMEM; | 1076 | return -ENOMEM; |
1077 | memcpy(c, &client_template, sizeof(struct i2c_client)); | 1077 | memcpy(c, &client_template, sizeof(struct i2c_client)); |
1078 | 1078 | ||
1079 | core = kzalloc(sizeof(struct tvp5150), GFP_KERNEL); | 1079 | core = kzalloc(sizeof(struct tvp5150), GFP_KERNEL); |
1080 | if (core == 0) { | 1080 | if (!core) { |
1081 | kfree(c); | 1081 | kfree(c); |
1082 | return -ENOMEM; | 1082 | return -ENOMEM; |
1083 | } | 1083 | } |
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) | |||
156 | find_ioctl(d->u.slave, cmd, | 156 | find_ioctl(d->u.slave, cmd, |
157 | (v4l2_int_ioctl_func *)no_such_ioctl_1))(d, arg); | 157 | (v4l2_int_ioctl_func *)no_such_ioctl_1))(d, arg); |
158 | } | 158 | } |
159 | |||
160 | 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) | |||
339 | /* Use kmalloc */ | 339 | /* Use kmalloc */ |
340 | 340 | ||
341 | mem = kmalloc(fh->v4l_buffers.buffer_size, GFP_KERNEL); | 341 | mem = kmalloc(fh->v4l_buffers.buffer_size, GFP_KERNEL); |
342 | if (mem == 0) { | 342 | if (!mem) { |
343 | dprintk(1, | 343 | dprintk(1, |
344 | KERN_ERR | 344 | KERN_ERR |
345 | "%s: v4l_fbuffer_alloc() - kmalloc for V4L buf %d failed\n", | 345 | "%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) | |||
390 | } | 390 | } |
391 | 391 | ||
392 | 392 | ||
393 | static ssize_t zr364xx_read(struct file *file, char *buf, size_t cnt, | 393 | static ssize_t zr364xx_read(struct file *file, char __user *buf, size_t cnt, |
394 | loff_t * ppos) | 394 | loff_t * ppos) |
395 | { | 395 | { |
396 | unsigned long count = cnt; | 396 | unsigned long count = cnt; |