aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/pci')
-rw-r--r--drivers/media/pci/bt8xx/bt878.c11
-rw-r--r--drivers/media/pci/bt8xx/bttv-cards.c34
-rw-r--r--drivers/media/pci/bt8xx/bttv-driver.c16
-rw-r--r--drivers/media/pci/bt8xx/bttv-i2c.c6
-rw-r--r--drivers/media/pci/bt8xx/bttv-input.c4
-rw-r--r--drivers/media/pci/bt8xx/dvb-bt8xx.c7
-rw-r--r--drivers/media/pci/cx18/cx18-alsa-main.c2
-rw-r--r--drivers/media/pci/cx18/cx18-alsa-pcm.c1
-rw-r--r--drivers/media/pci/cx18/cx18-driver.c14
-rw-r--r--drivers/media/pci/cx18/cx18-i2c.c2
-rw-r--r--drivers/media/pci/cx18/cx18-streams.c2
-rw-r--r--drivers/media/pci/cx23885/altera-ci.c45
-rw-r--r--drivers/media/pci/cx23885/cimax2.c17
-rw-r--r--drivers/media/pci/cx23885/cx23885-alsa.c6
-rw-r--r--drivers/media/pci/cx23885/cx23885-av.c1
-rw-r--r--drivers/media/pci/cx23885/cx23885-cards.c2
-rw-r--r--drivers/media/pci/cx23885/cx23885-core.c16
-rw-r--r--drivers/media/pci/cx23885/cx23885-dvb.c2
-rw-r--r--drivers/media/pci/cx23885/cx23885-f300.c1
-rw-r--r--drivers/media/pci/cx23885/cx23885-input.c7
-rw-r--r--drivers/media/pci/cx23885/cx23885-input.h2
-rw-r--r--drivers/media/pci/cx23885/cx23885-ioctl.c2
-rw-r--r--drivers/media/pci/cx23885/cx23885-ir.c1
-rw-r--r--drivers/media/pci/cx23885/cx23888-ir.c1
-rw-r--r--drivers/media/pci/cx23885/netup-init.c1
-rw-r--r--drivers/media/pci/cx25821/cx25821-audio-upstream.c44
-rw-r--r--drivers/media/pci/cx25821/cx25821-biffuncs.h6
-rw-r--r--drivers/media/pci/cx25821/cx25821-core.c8
-rw-r--r--drivers/media/pci/cx25821/cx25821-i2c.c4
-rw-r--r--drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c54
-rw-r--r--drivers/media/pci/cx25821/cx25821-video-upstream.c47
-rw-r--r--drivers/media/pci/cx25821/cx25821-video.c8
-rw-r--r--drivers/media/pci/cx88/cx88-alsa.c31
-rw-r--r--drivers/media/pci/cx88/cx88-blackbird.c7
-rw-r--r--drivers/media/pci/cx88/cx88-core.c12
-rw-r--r--drivers/media/pci/cx88/cx88-input.c8
-rw-r--r--drivers/media/pci/cx88/cx88-mpeg.c26
-rw-r--r--drivers/media/pci/cx88/cx88-video.c8
-rw-r--r--drivers/media/pci/cx88/cx88.h4
-rw-r--r--drivers/media/pci/ddbridge/ddbridge-core.c9
-rw-r--r--drivers/media/pci/dm1105/dm1105.c24
-rw-r--r--drivers/media/pci/ivtv/ivtv-alsa-main.c2
-rw-r--r--drivers/media/pci/ivtv/ivtv-alsa-pcm.c6
-rw-r--r--drivers/media/pci/ivtv/ivtv-alsa-pcm.h4
-rw-r--r--drivers/media/pci/ivtv/ivtv-driver.c9
-rw-r--r--drivers/media/pci/ivtv/ivtv-firmware.c2
-rw-r--r--drivers/media/pci/ivtv/ivtv-i2c.c8
-rw-r--r--drivers/media/pci/ivtv/ivtv-ioctl.c4
-rw-r--r--drivers/media/pci/mantis/hopper_cards.c9
-rw-r--r--drivers/media/pci/mantis/mantis_cards.c9
-rw-r--r--drivers/media/pci/mantis/mantis_dvb.c4
-rw-r--r--drivers/media/pci/mantis/mantis_i2c.c2
-rw-r--r--drivers/media/pci/mantis/mantis_input.c5
-rw-r--r--drivers/media/pci/mantis/mantis_pci.c2
-rw-r--r--drivers/media/pci/mantis/mantis_uart.c2
-rw-r--r--drivers/media/pci/mantis/mantis_vp1033.c6
-rw-r--r--drivers/media/pci/meye/meye.c9
-rw-r--r--drivers/media/pci/ngene/ngene-cards.c8
-rw-r--r--drivers/media/pci/ngene/ngene-core.c12
-rw-r--r--drivers/media/pci/ngene/ngene.h5
-rw-r--r--drivers/media/pci/pluto2/pluto2.c25
-rw-r--r--drivers/media/pci/pt1/pt1.c7
-rw-r--r--drivers/media/pci/saa7134/saa7134-core.c13
-rw-r--r--drivers/media/pci/saa7134/saa7134-input.c2
-rw-r--r--drivers/media/pci/saa7134/saa7134-video.c2
-rw-r--r--drivers/media/pci/saa7134/saa7134.h2
-rw-r--r--drivers/media/pci/saa7164/saa7164-api.c26
-rw-r--r--drivers/media/pci/saa7164/saa7164-bus.c6
-rw-r--r--drivers/media/pci/saa7164/saa7164-cmd.c16
-rw-r--r--drivers/media/pci/saa7164/saa7164-core.c12
-rw-r--r--drivers/media/pci/saa7164/saa7164-encoder.c15
-rw-r--r--drivers/media/pci/saa7164/saa7164-fw.c8
-rw-r--r--drivers/media/pci/saa7164/saa7164-vbi.c6
-rw-r--r--drivers/media/pci/sta2x11/sta2x11_vip.c8
-rw-r--r--drivers/media/pci/ttpci/av7110.c8
-rw-r--r--drivers/media/pci/ttpci/av7110.h1
-rw-r--r--drivers/media/pci/ttpci/av7110_ir.c4
-rw-r--r--drivers/media/pci/ttpci/budget-av.c4
-rw-r--r--drivers/media/pci/zoran/zoran_card.c20
-rw-r--r--drivers/media/pci/zoran/zoran_driver.c2
80 files changed, 411 insertions, 387 deletions
diff --git a/drivers/media/pci/bt8xx/bt878.c b/drivers/media/pci/bt8xx/bt878.c
index b34fa95185e4..66eb0baab0e9 100644
--- a/drivers/media/pci/bt8xx/bt878.c
+++ b/drivers/media/pci/bt8xx/bt878.c
@@ -391,7 +391,7 @@ EXPORT_SYMBOL(bt878_device_control);
391 .driver_data = (unsigned long) name \ 391 .driver_data = (unsigned long) name \
392 } 392 }
393 393
394static struct pci_device_id bt878_pci_tbl[] __devinitdata = { 394static struct pci_device_id bt878_pci_tbl[] = {
395 BROOKTREE_878_DEVICE(0x0071, 0x0101, "Nebula Electronics DigiTV"), 395 BROOKTREE_878_DEVICE(0x0071, 0x0101, "Nebula Electronics DigiTV"),
396 BROOKTREE_878_DEVICE(0x1461, 0x0761, "AverMedia AverTV DVB-T 761"), 396 BROOKTREE_878_DEVICE(0x1461, 0x0761, "AverMedia AverTV DVB-T 761"),
397 BROOKTREE_878_DEVICE(0x11bd, 0x001c, "Pinnacle PCTV Sat"), 397 BROOKTREE_878_DEVICE(0x11bd, 0x001c, "Pinnacle PCTV Sat"),
@@ -410,7 +410,7 @@ static struct pci_device_id bt878_pci_tbl[] __devinitdata = {
410 410
411MODULE_DEVICE_TABLE(pci, bt878_pci_tbl); 411MODULE_DEVICE_TABLE(pci, bt878_pci_tbl);
412 412
413static const char * __devinit card_name(const struct pci_device_id *id) 413static const char * card_name(const struct pci_device_id *id)
414{ 414{
415 return id->driver_data ? (const char *)id->driver_data : "Unknown"; 415 return id->driver_data ? (const char *)id->driver_data : "Unknown";
416} 416}
@@ -419,8 +419,7 @@ static const char * __devinit card_name(const struct pci_device_id *id)
419/* PCI device handling */ 419/* PCI device handling */
420/***********************/ 420/***********************/
421 421
422static int __devinit bt878_probe(struct pci_dev *dev, 422static int bt878_probe(struct pci_dev *dev, const struct pci_device_id *pci_id)
423 const struct pci_device_id *pci_id)
424{ 423{
425 int result = 0; 424 int result = 0;
426 unsigned char lat; 425 unsigned char lat;
@@ -529,7 +528,7 @@ static int __devinit bt878_probe(struct pci_dev *dev,
529 return result; 528 return result;
530} 529}
531 530
532static void __devexit bt878_remove(struct pci_dev *pci_dev) 531static void bt878_remove(struct pci_dev *pci_dev)
533{ 532{
534 u8 command; 533 u8 command;
535 struct bt878 *bt = pci_get_drvdata(pci_dev); 534 struct bt878 *bt = pci_get_drvdata(pci_dev);
@@ -573,7 +572,7 @@ static struct pci_driver bt878_pci_driver = {
573 .name = "bt878", 572 .name = "bt878",
574 .id_table = bt878_pci_tbl, 573 .id_table = bt878_pci_tbl,
575 .probe = bt878_probe, 574 .probe = bt878_probe,
576 .remove = __devexit_p(bt878_remove), 575 .remove = bt878_remove,
577}; 576};
578 577
579/*******************************/ 578/*******************************/
diff --git a/drivers/media/pci/bt8xx/bttv-cards.c b/drivers/media/pci/bt8xx/bttv-cards.c
index 38952faaffda..c4c59175e52c 100644
--- a/drivers/media/pci/bt8xx/bttv-cards.c
+++ b/drivers/media/pci/bt8xx/bttv-cards.c
@@ -87,7 +87,7 @@ static int tea5757_read(struct bttv *btv);
87static int tea5757_write(struct bttv *btv, int value); 87static int tea5757_write(struct bttv *btv, int value);
88static void identify_by_eeprom(struct bttv *btv, 88static void identify_by_eeprom(struct bttv *btv,
89 unsigned char eeprom_data[256]); 89 unsigned char eeprom_data[256]);
90static int __devinit pvr_boot(struct bttv *btv); 90static int pvr_boot(struct bttv *btv);
91 91
92/* config variables */ 92/* config variables */
93static unsigned int triton1; 93static unsigned int triton1;
@@ -151,7 +151,7 @@ static struct CARD {
151 unsigned id; 151 unsigned id;
152 int cardnr; 152 int cardnr;
153 char *name; 153 char *name;
154} cards[] __devinitdata = { 154} cards[] = {
155 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" }, 155 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
156 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" }, 156 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
157 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" }, 157 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
@@ -2837,7 +2837,7 @@ static unsigned char eeprom_data[256];
2837/* 2837/*
2838 * identify card 2838 * identify card
2839 */ 2839 */
2840void __devinit bttv_idcard(struct bttv *btv) 2840void bttv_idcard(struct bttv *btv)
2841{ 2841{
2842 unsigned int gpiobits; 2842 unsigned int gpiobits;
2843 int i,type; 2843 int i,type;
@@ -3235,7 +3235,7 @@ static void bttv_reset_audio(struct bttv *btv)
3235} 3235}
3236 3236
3237/* initialization part one -- before registering i2c bus */ 3237/* initialization part one -- before registering i2c bus */
3238void __devinit bttv_init_card1(struct bttv *btv) 3238void bttv_init_card1(struct bttv *btv)
3239{ 3239{
3240 switch (btv->c.type) { 3240 switch (btv->c.type) {
3241 case BTTV_BOARD_HAUPPAUGE: 3241 case BTTV_BOARD_HAUPPAUGE:
@@ -3267,7 +3267,7 @@ void __devinit bttv_init_card1(struct bttv *btv)
3267} 3267}
3268 3268
3269/* initialization part two -- after registering i2c bus */ 3269/* initialization part two -- after registering i2c bus */
3270void __devinit bttv_init_card2(struct bttv *btv) 3270void bttv_init_card2(struct bttv *btv)
3271{ 3271{
3272 btv->tuner_type = UNSET; 3272 btv->tuner_type = UNSET;
3273 3273
@@ -3571,7 +3571,7 @@ no_audio:
3571 3571
3572 3572
3573/* initialize the tuner */ 3573/* initialize the tuner */
3574void __devinit bttv_init_tuner(struct bttv *btv) 3574void bttv_init_tuner(struct bttv *btv)
3575{ 3575{
3576 int addr = ADDR_UNSET; 3576 int addr = ADDR_UNSET;
3577 3577
@@ -3635,7 +3635,7 @@ static void modtec_eeprom(struct bttv *btv)
3635 } 3635 }
3636} 3636}
3637 3637
3638static void __devinit hauppauge_eeprom(struct bttv *btv) 3638static void hauppauge_eeprom(struct bttv *btv)
3639{ 3639{
3640 struct tveeprom tv; 3640 struct tveeprom tv;
3641 3641
@@ -3709,8 +3709,7 @@ static int terratec_active_radio_upgrade(struct bttv *btv)
3709#define BTTV_ALT_DCLK 0x100000 3709#define BTTV_ALT_DCLK 0x100000
3710#define BTTV_ALT_NCONFIG 0x800000 3710#define BTTV_ALT_NCONFIG 0x800000
3711 3711
3712static int __devinit pvr_altera_load(struct bttv *btv, const u8 *micro, 3712static int pvr_altera_load(struct bttv *btv, const u8 *micro, u32 microlen)
3713 u32 microlen)
3714{ 3713{
3715 u32 n; 3714 u32 n;
3716 u8 bits; 3715 u8 bits;
@@ -3747,7 +3746,7 @@ static int __devinit pvr_altera_load(struct bttv *btv, const u8 *micro,
3747 return 0; 3746 return 0;
3748} 3747}
3749 3748
3750static int __devinit pvr_boot(struct bttv *btv) 3749static int pvr_boot(struct bttv *btv)
3751{ 3750{
3752 const struct firmware *fw_entry; 3751 const struct firmware *fw_entry;
3753 int rc; 3752 int rc;
@@ -3767,7 +3766,7 @@ static int __devinit pvr_boot(struct bttv *btv)
3767/* ----------------------------------------------------------------------- */ 3766/* ----------------------------------------------------------------------- */
3768/* some osprey specific stuff */ 3767/* some osprey specific stuff */
3769 3768
3770static void __devinit osprey_eeprom(struct bttv *btv, const u8 ee[256]) 3769static void osprey_eeprom(struct bttv *btv, const u8 ee[256])
3771{ 3770{
3772 int i; 3771 int i;
3773 u32 serial = 0; 3772 u32 serial = 0;
@@ -3898,7 +3897,7 @@ static int tuner_1_table[] = {
3898 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */ 3897 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3899 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL}; 3898 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
3900 3899
3901static void __devinit avermedia_eeprom(struct bttv *btv) 3900static void avermedia_eeprom(struct bttv *btv)
3902{ 3901{
3903 int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0; 3902 int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0;
3904 3903
@@ -3960,7 +3959,7 @@ u32 bttv_tda9880_setnorm(struct bttv *btv, u32 gpiobits)
3960 * Hauppauge: pin 5 3959 * Hauppauge: pin 5
3961 * Voodoo: pin 20 3960 * Voodoo: pin 20
3962 */ 3961 */
3963static void __devinit boot_msp34xx(struct bttv *btv, int pin) 3962static void boot_msp34xx(struct bttv *btv, int pin)
3964{ 3963{
3965 int mask = (1 << pin); 3964 int mask = (1 << pin);
3966 3965
@@ -3983,11 +3982,10 @@ static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3983 * used by Alessandro Rubini in his pxc200 3982 * used by Alessandro Rubini in his pxc200
3984 * driver, but using BTTV functions */ 3983 * driver, but using BTTV functions */
3985 3984
3986static void __devinit init_PXC200(struct bttv *btv) 3985static void init_PXC200(struct bttv *btv)
3987{ 3986{
3988 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d, 3987 static int vals[] = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d, 0x01, 0x02,
3989 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 3988 0x03, 0x04, 0x05, 0x06, 0x00 };
3990 0x00 };
3991 unsigned int i; 3989 unsigned int i;
3992 int tmp; 3990 int tmp;
3993 u32 val; 3991 u32 val;
@@ -4851,7 +4849,7 @@ void __init bttv_check_chipset(void)
4851 } 4849 }
4852} 4850}
4853 4851
4854int __devinit bttv_handle_chipset(struct bttv *btv) 4852int bttv_handle_chipset(struct bttv *btv)
4855{ 4853{
4856 unsigned char command; 4854 unsigned char command;
4857 4855
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index 56c6c77793d7..45e5d0661b60 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -200,7 +200,7 @@ static void flush_request_modules(struct bttv *dev)
200} 200}
201#else 201#else
202#define request_modules(dev) 202#define request_modules(dev)
203#define flush_request_modules(dev) 203#define flush_request_modules(dev) do {} while(0)
204#endif /* CONFIG_MODULES */ 204#endif /* CONFIG_MODULES */
205 205
206 206
@@ -301,11 +301,10 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
301 /* totalwidth */ 1135, 301 /* totalwidth */ 1135,
302 /* sqwidth */ 944, 302 /* sqwidth */ 944,
303 /* vdelay */ 0x20, 303 /* vdelay */ 0x20,
304 /* sheight */ 576,
305 /* videostart0 */ 23)
306 /* bt878 (and bt848?) can capture another 304 /* bt878 (and bt848?) can capture another
307 line below active video. */ 305 line below active video. */
308 .cropcap.bounds.height = (576 + 2) + 0x20 - 2, 306 /* sheight */ (576 + 2) + 0x20 - 2,
307 /* videostart0 */ 23)
309 },{ 308 },{
310 .v4l2_id = V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR, 309 .v4l2_id = V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR,
311 .name = "NTSC", 310 .name = "NTSC",
@@ -4200,7 +4199,7 @@ static void bttv_unregister_video(struct bttv *btv)
4200} 4199}
4201 4200
4202/* register video4linux devices */ 4201/* register video4linux devices */
4203static int __devinit bttv_register_video(struct bttv *btv) 4202static int bttv_register_video(struct bttv *btv)
4204{ 4203{
4205 if (no_overlay > 0) 4204 if (no_overlay > 0)
4206 pr_notice("Overlay support disabled\n"); 4205 pr_notice("Overlay support disabled\n");
@@ -4266,8 +4265,7 @@ static void pci_set_command(struct pci_dev *dev)
4266#endif 4265#endif
4267} 4266}
4268 4267
4269static int __devinit bttv_probe(struct pci_dev *dev, 4268static int bttv_probe(struct pci_dev *dev, const struct pci_device_id *pci_id)
4270 const struct pci_device_id *pci_id)
4271{ 4269{
4272 int result; 4270 int result;
4273 unsigned char lat; 4271 unsigned char lat;
@@ -4455,7 +4453,7 @@ fail0:
4455 return result; 4453 return result;
4456} 4454}
4457 4455
4458static void __devexit bttv_remove(struct pci_dev *pci_dev) 4456static void bttv_remove(struct pci_dev *pci_dev)
4459{ 4457{
4460 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev); 4458 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev);
4461 struct bttv *btv = to_bttv(v4l2_dev); 4459 struct bttv *btv = to_bttv(v4l2_dev);
@@ -4599,7 +4597,7 @@ static struct pci_driver bttv_pci_driver = {
4599 .name = "bttv", 4597 .name = "bttv",
4600 .id_table = bttv_pci_tbl, 4598 .id_table = bttv_pci_tbl,
4601 .probe = bttv_probe, 4599 .probe = bttv_probe,
4602 .remove = __devexit_p(bttv_remove), 4600 .remove = bttv_remove,
4603#ifdef CONFIG_PM 4601#ifdef CONFIG_PM
4604 .suspend = bttv_suspend, 4602 .suspend = bttv_suspend,
4605 .resume = bttv_resume, 4603 .resume = bttv_resume,
diff --git a/drivers/media/pci/bt8xx/bttv-i2c.c b/drivers/media/pci/bt8xx/bttv-i2c.c
index 580c8e682392..5039b8826e0a 100644
--- a/drivers/media/pci/bt8xx/bttv-i2c.c
+++ b/drivers/media/pci/bt8xx/bttv-i2c.c
@@ -99,7 +99,7 @@ static int bttv_bit_getsda(void *data)
99 return state; 99 return state;
100} 100}
101 101
102static struct i2c_algo_bit_data __devinitdata bttv_i2c_algo_bit_template = { 102static struct i2c_algo_bit_data bttv_i2c_algo_bit_template = {
103 .setsda = bttv_bit_setsda, 103 .setsda = bttv_bit_setsda,
104 .setscl = bttv_bit_setscl, 104 .setscl = bttv_bit_setscl,
105 .getsda = bttv_bit_getsda, 105 .getsda = bttv_bit_getsda,
@@ -312,7 +312,7 @@ int bttv_I2CWrite(struct bttv *btv, unsigned char addr, unsigned char b1,
312} 312}
313 313
314/* read EEPROM content */ 314/* read EEPROM content */
315void __devinit bttv_readee(struct bttv *btv, unsigned char *eedata, int addr) 315void bttv_readee(struct bttv *btv, unsigned char *eedata, int addr)
316{ 316{
317 memset(eedata, 0, 256); 317 memset(eedata, 0, 256);
318 if (0 != btv->i2c_rc) 318 if (0 != btv->i2c_rc)
@@ -347,7 +347,7 @@ static void do_i2c_scan(char *name, struct i2c_client *c)
347} 347}
348 348
349/* init + register i2c adapter */ 349/* init + register i2c adapter */
350int __devinit init_bttv_i2c(struct bttv *btv) 350int init_bttv_i2c(struct bttv *btv)
351{ 351{
352 strlcpy(btv->i2c_client.name, "bttv internal", I2C_NAME_SIZE); 352 strlcpy(btv->i2c_client.name, "bttv internal", I2C_NAME_SIZE);
353 353
diff --git a/drivers/media/pci/bt8xx/bttv-input.c b/drivers/media/pci/bt8xx/bttv-input.c
index ef4c7cd41982..04207a799055 100644
--- a/drivers/media/pci/bt8xx/bttv-input.c
+++ b/drivers/media/pci/bt8xx/bttv-input.c
@@ -368,7 +368,7 @@ static int get_key_pv951(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
368} 368}
369 369
370/* Instantiate the I2C IR receiver device, if present */ 370/* Instantiate the I2C IR receiver device, if present */
371void __devinit init_bttv_i2c_ir(struct bttv *btv) 371void init_bttv_i2c_ir(struct bttv *btv)
372{ 372{
373 const unsigned short addr_list[] = { 373 const unsigned short addr_list[] = {
374 0x1a, 0x18, 0x64, 0x30, 0x71, 374 0x1a, 0x18, 0x64, 0x30, 0x71,
@@ -411,7 +411,7 @@ void __devinit init_bttv_i2c_ir(struct bttv *btv)
411 return; 411 return;
412} 412}
413 413
414int __devexit fini_bttv_i2c(struct bttv *btv) 414int fini_bttv_i2c(struct bttv *btv)
415{ 415{
416 if (0 != btv->i2c_rc) 416 if (0 != btv->i2c_rc)
417 return 0; 417 return 0;
diff --git a/drivers/media/pci/bt8xx/dvb-bt8xx.c b/drivers/media/pci/bt8xx/dvb-bt8xx.c
index 81fab9adc1ca..d407244fd1bc 100644
--- a/drivers/media/pci/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/pci/bt8xx/dvb-bt8xx.c
@@ -118,7 +118,8 @@ static int is_pci_slot_eq(struct pci_dev* adev, struct pci_dev* bdev)
118 return 0; 118 return 0;
119} 119}
120 120
121static struct bt878 __devinit *dvb_bt8xx_878_match(unsigned int bttv_nr, struct pci_dev* bttv_pci_dev) 121static struct bt878 *dvb_bt8xx_878_match(unsigned int bttv_nr,
122 struct pci_dev* bttv_pci_dev)
122{ 123{
123 unsigned int card_nr; 124 unsigned int card_nr;
124 125
@@ -720,7 +721,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
720 } 721 }
721} 722}
722 723
723static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) 724static int dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type)
724{ 725{
725 int result; 726 int result;
726 727
@@ -811,7 +812,7 @@ err_unregister_adaptor:
811 return result; 812 return result;
812} 813}
813 814
814static int __devinit dvb_bt8xx_probe(struct bttv_sub_device *sub) 815static int dvb_bt8xx_probe(struct bttv_sub_device *sub)
815{ 816{
816 struct dvb_bt8xx_card *card; 817 struct dvb_bt8xx_card *card;
817 struct pci_dev* bttv_pci_dev; 818 struct pci_dev* bttv_pci_dev;
diff --git a/drivers/media/pci/cx18/cx18-alsa-main.c b/drivers/media/pci/cx18/cx18-alsa-main.c
index 6d2a98246b6d..8e971ff60588 100644
--- a/drivers/media/pci/cx18/cx18-alsa-main.c
+++ b/drivers/media/pci/cx18/cx18-alsa-main.c
@@ -197,7 +197,7 @@ err_exit:
197 return ret; 197 return ret;
198} 198}
199 199
200int cx18_alsa_load(struct cx18 *cx) 200static int __init cx18_alsa_load(struct cx18 *cx)
201{ 201{
202 struct v4l2_device *v4l2_dev = &cx->v4l2_dev; 202 struct v4l2_device *v4l2_dev = &cx->v4l2_dev;
203 struct cx18_stream *s; 203 struct cx18_stream *s;
diff --git a/drivers/media/pci/cx18/cx18-alsa-pcm.c b/drivers/media/pci/cx18/cx18-alsa-pcm.c
index 7a5b84a86bb3..180077c49123 100644
--- a/drivers/media/pci/cx18/cx18-alsa-pcm.c
+++ b/drivers/media/pci/cx18/cx18-alsa-pcm.c
@@ -37,6 +37,7 @@
37#include "cx18-streams.h" 37#include "cx18-streams.h"
38#include "cx18-fileops.h" 38#include "cx18-fileops.h"
39#include "cx18-alsa.h" 39#include "cx18-alsa.h"
40#include "cx18-alsa-pcm.h"
40 41
41static unsigned int pcm_debug; 42static unsigned int pcm_debug;
42module_param(pcm_debug, int, 0644); 43module_param(pcm_debug, int, 0644);
diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c
index 039133d692e3..613e5ae7d5ca 100644
--- a/drivers/media/pci/cx18/cx18-driver.c
+++ b/drivers/media/pci/cx18/cx18-driver.c
@@ -53,7 +53,7 @@ int (*cx18_ext_init)(struct cx18 *);
53EXPORT_SYMBOL(cx18_ext_init); 53EXPORT_SYMBOL(cx18_ext_init);
54 54
55/* add your revision and whatnot here */ 55/* add your revision and whatnot here */
56static struct pci_device_id cx18_pci_tbl[] __devinitdata = { 56static struct pci_device_id cx18_pci_tbl[] = {
57 {PCI_VENDOR_ID_CX, PCI_DEVICE_ID_CX23418, 57 {PCI_VENDOR_ID_CX, PCI_DEVICE_ID_CX23418,
58 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 58 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
59 {0,} 59 {0,}
@@ -691,7 +691,7 @@ done:
691 cx->card_i2c = cx->card->i2c; 691 cx->card_i2c = cx->card->i2c;
692} 692}
693 693
694static int __devinit cx18_create_in_workq(struct cx18 *cx) 694static int cx18_create_in_workq(struct cx18 *cx)
695{ 695{
696 snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in", 696 snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in",
697 cx->v4l2_dev.name); 697 cx->v4l2_dev.name);
@@ -703,7 +703,7 @@ static int __devinit cx18_create_in_workq(struct cx18 *cx)
703 return 0; 703 return 0;
704} 704}
705 705
706static void __devinit cx18_init_in_work_orders(struct cx18 *cx) 706static void cx18_init_in_work_orders(struct cx18 *cx)
707{ 707{
708 int i; 708 int i;
709 for (i = 0; i < CX18_MAX_IN_WORK_ORDERS; i++) { 709 for (i = 0; i < CX18_MAX_IN_WORK_ORDERS; i++) {
@@ -718,7 +718,7 @@ static void __devinit cx18_init_in_work_orders(struct cx18 *cx)
718 No assumptions on the card type may be made here (see cx18_init_struct2 718 No assumptions on the card type may be made here (see cx18_init_struct2
719 for that). 719 for that).
720 */ 720 */
721static int __devinit cx18_init_struct1(struct cx18 *cx) 721static int cx18_init_struct1(struct cx18 *cx)
722{ 722{
723 int ret; 723 int ret;
724 724
@@ -775,7 +775,7 @@ static int __devinit cx18_init_struct1(struct cx18 *cx)
775 775
776/* Second initialization part. Here the card type has been 776/* Second initialization part. Here the card type has been
777 autodetected. */ 777 autodetected. */
778static void __devinit cx18_init_struct2(struct cx18 *cx) 778static void cx18_init_struct2(struct cx18 *cx)
779{ 779{
780 int i; 780 int i;
781 781
@@ -892,8 +892,8 @@ static void cx18_init_subdevs(struct cx18 *cx)
892 cx->sd_extmux = cx18_find_hw(cx, cx->card->hw_muxer); 892 cx->sd_extmux = cx18_find_hw(cx, cx->card->hw_muxer);
893} 893}
894 894
895static int __devinit cx18_probe(struct pci_dev *pci_dev, 895static int cx18_probe(struct pci_dev *pci_dev,
896 const struct pci_device_id *pci_id) 896 const struct pci_device_id *pci_id)
897{ 897{
898 int retval = 0; 898 int retval = 0;
899 int i; 899 int i;
diff --git a/drivers/media/pci/cx18/cx18-i2c.c b/drivers/media/pci/cx18/cx18-i2c.c
index 51609d5c88ce..4908eb7bcf6c 100644
--- a/drivers/media/pci/cx18/cx18-i2c.c
+++ b/drivers/media/pci/cx18/cx18-i2c.c
@@ -98,7 +98,7 @@ static int cx18_i2c_new_ir(struct cx18 *cx, struct i2c_adapter *adap, u32 hw,
98 case CX18_HW_Z8F0811_IR_RX_HAUP: 98 case CX18_HW_Z8F0811_IR_RX_HAUP:
99 init_data->ir_codes = RC_MAP_HAUPPAUGE; 99 init_data->ir_codes = RC_MAP_HAUPPAUGE;
100 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; 100 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
101 init_data->type = RC_TYPE_RC5; 101 init_data->type = RC_BIT_RC5;
102 init_data->name = cx->card_name; 102 init_data->name = cx->card_name;
103 info.platform_data = init_data; 103 info.platform_data = init_data;
104 break; 104 break;
diff --git a/drivers/media/pci/cx18/cx18-streams.c b/drivers/media/pci/cx18/cx18-streams.c
index 72af9b5c2d7d..843c62b2f482 100644
--- a/drivers/media/pci/cx18/cx18-streams.c
+++ b/drivers/media/pci/cx18/cx18-streams.c
@@ -97,7 +97,7 @@ static struct {
97}; 97};
98 98
99 99
100void cx18_dma_free(struct videobuf_queue *q, 100static void cx18_dma_free(struct videobuf_queue *q,
101 struct cx18_stream *s, struct cx18_videobuf_buffer *buf) 101 struct cx18_stream *s, struct cx18_videobuf_buffer *buf)
102{ 102{
103 videobuf_waiton(q, &buf->vb, 0, 0); 103 videobuf_waiton(q, &buf->vb, 0, 0);
diff --git a/drivers/media/pci/cx23885/altera-ci.c b/drivers/media/pci/cx23885/altera-ci.c
index 495781ee4711..2926f7fadccd 100644
--- a/drivers/media/pci/cx23885/altera-ci.c
+++ b/drivers/media/pci/cx23885/altera-ci.c
@@ -263,7 +263,7 @@ static int netup_fpga_op_rw(struct fpga_internal *inter, int addr,
263} 263}
264 264
265/* flag - mem/io, read - read/write */ 265/* flag - mem/io, read - read/write */
266int altera_ci_op_cam(struct dvb_ca_en50221 *en50221, int slot, 266static int altera_ci_op_cam(struct dvb_ca_en50221 *en50221, int slot,
267 u8 flag, u8 read, int addr, u8 val) 267 u8 flag, u8 read, int addr, u8 val)
268{ 268{
269 269
@@ -298,31 +298,32 @@ int altera_ci_op_cam(struct dvb_ca_en50221 *en50221, int slot,
298 return mem; 298 return mem;
299} 299}
300 300
301int altera_ci_read_attribute_mem(struct dvb_ca_en50221 *en50221, 301static int altera_ci_read_attribute_mem(struct dvb_ca_en50221 *en50221,
302 int slot, int addr) 302 int slot, int addr)
303{ 303{
304 return altera_ci_op_cam(en50221, slot, 0, NETUP_CI_FLG_RD, addr, 0); 304 return altera_ci_op_cam(en50221, slot, 0, NETUP_CI_FLG_RD, addr, 0);
305} 305}
306 306
307int altera_ci_write_attribute_mem(struct dvb_ca_en50221 *en50221, 307static int altera_ci_write_attribute_mem(struct dvb_ca_en50221 *en50221,
308 int slot, int addr, u8 data) 308 int slot, int addr, u8 data)
309{ 309{
310 return altera_ci_op_cam(en50221, slot, 0, 0, addr, data); 310 return altera_ci_op_cam(en50221, slot, 0, 0, addr, data);
311} 311}
312 312
313int altera_ci_read_cam_ctl(struct dvb_ca_en50221 *en50221, int slot, u8 addr) 313static int altera_ci_read_cam_ctl(struct dvb_ca_en50221 *en50221,
314 int slot, u8 addr)
314{ 315{
315 return altera_ci_op_cam(en50221, slot, NETUP_CI_FLG_CTL, 316 return altera_ci_op_cam(en50221, slot, NETUP_CI_FLG_CTL,
316 NETUP_CI_FLG_RD, addr, 0); 317 NETUP_CI_FLG_RD, addr, 0);
317} 318}
318 319
319int altera_ci_write_cam_ctl(struct dvb_ca_en50221 *en50221, int slot, 320static int altera_ci_write_cam_ctl(struct dvb_ca_en50221 *en50221, int slot,
320 u8 addr, u8 data) 321 u8 addr, u8 data)
321{ 322{
322 return altera_ci_op_cam(en50221, slot, NETUP_CI_FLG_CTL, 0, addr, data); 323 return altera_ci_op_cam(en50221, slot, NETUP_CI_FLG_CTL, 0, addr, data);
323} 324}
324 325
325int altera_ci_slot_reset(struct dvb_ca_en50221 *en50221, int slot) 326static int altera_ci_slot_reset(struct dvb_ca_en50221 *en50221, int slot)
326{ 327{
327 struct altera_ci_state *state = en50221->data; 328 struct altera_ci_state *state = en50221->data;
328 struct fpga_internal *inter = state->internal; 329 struct fpga_internal *inter = state->internal;
@@ -365,13 +366,13 @@ int altera_ci_slot_reset(struct dvb_ca_en50221 *en50221, int slot)
365 return 0; 366 return 0;
366} 367}
367 368
368int altera_ci_slot_shutdown(struct dvb_ca_en50221 *en50221, int slot) 369static int altera_ci_slot_shutdown(struct dvb_ca_en50221 *en50221, int slot)
369{ 370{
370 /* not implemented */ 371 /* not implemented */
371 return 0; 372 return 0;
372} 373}
373 374
374int altera_ci_slot_ts_ctl(struct dvb_ca_en50221 *en50221, int slot) 375static int altera_ci_slot_ts_ctl(struct dvb_ca_en50221 *en50221, int slot)
375{ 376{
376 struct altera_ci_state *state = en50221->data; 377 struct altera_ci_state *state = en50221->data;
377 struct fpga_internal *inter = state->internal; 378 struct fpga_internal *inter = state->internal;
@@ -448,8 +449,8 @@ int altera_ci_irq(void *dev)
448} 449}
449EXPORT_SYMBOL(altera_ci_irq); 450EXPORT_SYMBOL(altera_ci_irq);
450 451
451int altera_poll_ci_slot_status(struct dvb_ca_en50221 *en50221, int slot, 452static int altera_poll_ci_slot_status(struct dvb_ca_en50221 *en50221,
452 int open) 453 int slot, int open)
453{ 454{
454 struct altera_ci_state *state = en50221->data; 455 struct altera_ci_state *state = en50221->data;
455 456
@@ -459,7 +460,7 @@ int altera_poll_ci_slot_status(struct dvb_ca_en50221 *en50221, int slot,
459 return state->status; 460 return state->status;
460} 461}
461 462
462void altera_hw_filt_release(void *main_dev, int filt_nr) 463static void altera_hw_filt_release(void *main_dev, int filt_nr)
463{ 464{
464 struct fpga_inode *temp_int = find_inode(main_dev); 465 struct fpga_inode *temp_int = find_inode(main_dev);
465 struct netup_hw_pid_filter *pid_filt = NULL; 466 struct netup_hw_pid_filter *pid_filt = NULL;
@@ -581,7 +582,7 @@ static void altera_toggle_fullts_streaming(struct netup_hw_pid_filter *pid_filt,
581 mutex_unlock(&inter->fpga_mutex); 582 mutex_unlock(&inter->fpga_mutex);
582} 583}
583 584
584int altera_pid_feed_control(void *demux_dev, int filt_nr, 585static int altera_pid_feed_control(void *demux_dev, int filt_nr,
585 struct dvb_demux_feed *feed, int onoff) 586 struct dvb_demux_feed *feed, int onoff)
586{ 587{
587 struct fpga_inode *temp_int = find_dinode(demux_dev); 588 struct fpga_inode *temp_int = find_dinode(demux_dev);
@@ -603,41 +604,41 @@ int altera_pid_feed_control(void *demux_dev, int filt_nr,
603} 604}
604EXPORT_SYMBOL(altera_pid_feed_control); 605EXPORT_SYMBOL(altera_pid_feed_control);
605 606
606int altera_ci_start_feed(struct dvb_demux_feed *feed, int num) 607static int altera_ci_start_feed(struct dvb_demux_feed *feed, int num)
607{ 608{
608 altera_pid_feed_control(feed->demux, num, feed, 1); 609 altera_pid_feed_control(feed->demux, num, feed, 1);
609 610
610 return 0; 611 return 0;
611} 612}
612 613
613int altera_ci_stop_feed(struct dvb_demux_feed *feed, int num) 614static int altera_ci_stop_feed(struct dvb_demux_feed *feed, int num)
614{ 615{
615 altera_pid_feed_control(feed->demux, num, feed, 0); 616 altera_pid_feed_control(feed->demux, num, feed, 0);
616 617
617 return 0; 618 return 0;
618} 619}
619 620
620int altera_ci_start_feed_1(struct dvb_demux_feed *feed) 621static int altera_ci_start_feed_1(struct dvb_demux_feed *feed)
621{ 622{
622 return altera_ci_start_feed(feed, 1); 623 return altera_ci_start_feed(feed, 1);
623} 624}
624 625
625int altera_ci_stop_feed_1(struct dvb_demux_feed *feed) 626static int altera_ci_stop_feed_1(struct dvb_demux_feed *feed)
626{ 627{
627 return altera_ci_stop_feed(feed, 1); 628 return altera_ci_stop_feed(feed, 1);
628} 629}
629 630
630int altera_ci_start_feed_2(struct dvb_demux_feed *feed) 631static int altera_ci_start_feed_2(struct dvb_demux_feed *feed)
631{ 632{
632 return altera_ci_start_feed(feed, 2); 633 return altera_ci_start_feed(feed, 2);
633} 634}
634 635
635int altera_ci_stop_feed_2(struct dvb_demux_feed *feed) 636static int altera_ci_stop_feed_2(struct dvb_demux_feed *feed)
636{ 637{
637 return altera_ci_stop_feed(feed, 2); 638 return altera_ci_stop_feed(feed, 2);
638} 639}
639 640
640int altera_hw_filt_init(struct altera_ci_config *config, int hw_filt_nr) 641static int altera_hw_filt_init(struct altera_ci_config *config, int hw_filt_nr)
641{ 642{
642 struct netup_hw_pid_filter *pid_filt = NULL; 643 struct netup_hw_pid_filter *pid_filt = NULL;
643 struct fpga_inode *temp_int = find_inode(config->dev); 644 struct fpga_inode *temp_int = find_inode(config->dev);
diff --git a/drivers/media/pci/cx23885/cimax2.c b/drivers/media/pci/cx23885/cimax2.c
index 6617774a326a..7344849183a7 100644
--- a/drivers/media/pci/cx23885/cimax2.c
+++ b/drivers/media/pci/cx23885/cimax2.c
@@ -24,6 +24,7 @@
24 */ 24 */
25 25
26#include "cx23885.h" 26#include "cx23885.h"
27#include "cimax2.h"
27#include "dvb_ca_en50221.h" 28#include "dvb_ca_en50221.h"
28/**** Bit definitions for MC417_RWD and MC417_OEN registers *** 29/**** Bit definitions for MC417_RWD and MC417_OEN registers ***
29 bits 31-16 30 bits 31-16
@@ -87,7 +88,7 @@ struct netup_ci_state {
87}; 88};
88 89
89 90
90int netup_read_i2c(struct i2c_adapter *i2c_adap, u8 addr, u8 reg, 91static int netup_read_i2c(struct i2c_adapter *i2c_adap, u8 addr, u8 reg,
91 u8 *buf, int len) 92 u8 *buf, int len)
92{ 93{
93 int ret; 94 int ret;
@@ -120,7 +121,7 @@ int netup_read_i2c(struct i2c_adapter *i2c_adap, u8 addr, u8 reg,
120 return 0; 121 return 0;
121} 122}
122 123
123int netup_write_i2c(struct i2c_adapter *i2c_adap, u8 addr, u8 reg, 124static int netup_write_i2c(struct i2c_adapter *i2c_adap, u8 addr, u8 reg,
124 u8 *buf, int len) 125 u8 *buf, int len)
125{ 126{
126 int ret; 127 int ret;
@@ -147,7 +148,7 @@ int netup_write_i2c(struct i2c_adapter *i2c_adap, u8 addr, u8 reg,
147 return 0; 148 return 0;
148} 149}
149 150
150int netup_ci_get_mem(struct cx23885_dev *dev) 151static int netup_ci_get_mem(struct cx23885_dev *dev)
151{ 152{
152 int mem; 153 int mem;
153 unsigned long timeout = jiffies + msecs_to_jiffies(1); 154 unsigned long timeout = jiffies + msecs_to_jiffies(1);
@@ -166,7 +167,7 @@ int netup_ci_get_mem(struct cx23885_dev *dev)
166 return mem & 0xff; 167 return mem & 0xff;
167} 168}
168 169
169int netup_ci_op_cam(struct dvb_ca_en50221 *en50221, int slot, 170static int netup_ci_op_cam(struct dvb_ca_en50221 *en50221, int slot,
170 u8 flag, u8 read, int addr, u8 data) 171 u8 flag, u8 read, int addr, u8 data)
171{ 172{
172 struct netup_ci_state *state = en50221->data; 173 struct netup_ci_state *state = en50221->data;
@@ -248,7 +249,8 @@ int netup_ci_write_attribute_mem(struct dvb_ca_en50221 *en50221,
248 return netup_ci_op_cam(en50221, slot, 0, 0, addr, data); 249 return netup_ci_op_cam(en50221, slot, 0, 0, addr, data);
249} 250}
250 251
251int netup_ci_read_cam_ctl(struct dvb_ca_en50221 *en50221, int slot, u8 addr) 252int netup_ci_read_cam_ctl(struct dvb_ca_en50221 *en50221, int slot,
253 u8 addr)
252{ 254{
253 return netup_ci_op_cam(en50221, slot, NETUP_CI_CTL, 255 return netup_ci_op_cam(en50221, slot, NETUP_CI_CTL,
254 NETUP_CI_RD, addr, 0); 256 NETUP_CI_RD, addr, 0);
@@ -295,7 +297,7 @@ int netup_ci_slot_shutdown(struct dvb_ca_en50221 *en50221, int slot)
295 return 0; 297 return 0;
296} 298}
297 299
298int netup_ci_set_irq(struct dvb_ca_en50221 *en50221, u8 irq_mode) 300static int netup_ci_set_irq(struct dvb_ca_en50221 *en50221, u8 irq_mode)
299{ 301{
300 struct netup_ci_state *state = en50221->data; 302 struct netup_ci_state *state = en50221->data;
301 int ret; 303 int ret;
@@ -399,7 +401,8 @@ int netup_ci_slot_status(struct cx23885_dev *dev, u32 pci_status)
399 return 1; 401 return 1;
400} 402}
401 403
402int netup_poll_ci_slot_status(struct dvb_ca_en50221 *en50221, int slot, int open) 404int netup_poll_ci_slot_status(struct dvb_ca_en50221 *en50221,
405 int slot, int open)
403{ 406{
404 struct netup_ci_state *state = en50221->data; 407 struct netup_ci_state *state = en50221->data;
405 408
diff --git a/drivers/media/pci/cx23885/cx23885-alsa.c b/drivers/media/pci/cx23885/cx23885-alsa.c
index 795169237e70..c6c9bd58f8be 100644
--- a/drivers/media/pci/cx23885/cx23885-alsa.c
+++ b/drivers/media/pci/cx23885/cx23885-alsa.c
@@ -45,8 +45,10 @@
45 45
46#define AUDIO_SRAM_CHANNEL SRAM_CH07 46#define AUDIO_SRAM_CHANNEL SRAM_CH07
47 47
48#define dprintk(level, fmt, arg...) if (audio_debug >= level) \ 48#define dprintk(level, fmt, arg...) do { \
49 printk(KERN_INFO "%s: " fmt, chip->dev->name , ## arg) 49 if (audio_debug + 1 > level) \
50 printk(KERN_INFO "%s: " fmt, chip->dev->name , ## arg); \
51} while(0)
50 52
51#define dprintk_core(level, fmt, arg...) if (audio_debug >= level) \ 53#define dprintk_core(level, fmt, arg...) if (audio_debug >= level) \
52 printk(KERN_DEBUG "%s: " fmt, chip->dev->name , ## arg) 54 printk(KERN_DEBUG "%s: " fmt, chip->dev->name , ## arg)
diff --git a/drivers/media/pci/cx23885/cx23885-av.c b/drivers/media/pci/cx23885/cx23885-av.c
index 134ebddd860f..e958a01fd554 100644
--- a/drivers/media/pci/cx23885/cx23885-av.c
+++ b/drivers/media/pci/cx23885/cx23885-av.c
@@ -22,6 +22,7 @@
22 */ 22 */
23 23
24#include "cx23885.h" 24#include "cx23885.h"
25#include "cx23885-av.h"
25 26
26void cx23885_av_work_handler(struct work_struct *work) 27void cx23885_av_work_handler(struct work_struct *work)
27{ 28{
diff --git a/drivers/media/pci/cx23885/cx23885-cards.c b/drivers/media/pci/cx23885/cx23885-cards.c
index 5acdf954ff6b..6277e145f0b8 100644
--- a/drivers/media/pci/cx23885/cx23885-cards.c
+++ b/drivers/media/pci/cx23885/cx23885-cards.c
@@ -1427,7 +1427,7 @@ void cx23885_ir_fini(struct cx23885_dev *dev)
1427 } 1427 }
1428} 1428}
1429 1429
1430int netup_jtag_io(void *device, int tms, int tdi, int read_tdo) 1430static int netup_jtag_io(void *device, int tms, int tdi, int read_tdo)
1431{ 1431{
1432 int data; 1432 int data;
1433 int tdo = 0; 1433 int tdo = 0;
diff --git a/drivers/media/pci/cx23885/cx23885-core.c b/drivers/media/pci/cx23885/cx23885-core.c
index 697728f09430..f0416a668b4c 100644
--- a/drivers/media/pci/cx23885/cx23885-core.c
+++ b/drivers/media/pci/cx23885/cx23885-core.c
@@ -303,7 +303,7 @@ static struct sram_channel cx23887_sram_channels[] = {
303 }, 303 },
304}; 304};
305 305
306void cx23885_irq_add(struct cx23885_dev *dev, u32 mask) 306static void cx23885_irq_add(struct cx23885_dev *dev, u32 mask)
307{ 307{
308 unsigned long flags; 308 unsigned long flags;
309 spin_lock_irqsave(&dev->pci_irqmask_lock, flags); 309 spin_lock_irqsave(&dev->pci_irqmask_lock, flags);
@@ -1516,8 +1516,7 @@ int cx23885_restart_queue(struct cx23885_tsport *port,
1516 buf = list_entry(q->queued.next, struct cx23885_buffer, 1516 buf = list_entry(q->queued.next, struct cx23885_buffer,
1517 vb.queue); 1517 vb.queue);
1518 if (NULL == prev) { 1518 if (NULL == prev) {
1519 list_del(&buf->vb.queue); 1519 list_move_tail(&buf->vb.queue, &q->active);
1520 list_add_tail(&buf->vb.queue, &q->active);
1521 cx23885_start_dma(port, q, buf); 1520 cx23885_start_dma(port, q, buf);
1522 buf->vb.state = VIDEOBUF_ACTIVE; 1521 buf->vb.state = VIDEOBUF_ACTIVE;
1523 buf->count = q->count++; 1522 buf->count = q->count++;
@@ -1528,8 +1527,7 @@ int cx23885_restart_queue(struct cx23885_tsport *port,
1528 } else if (prev->vb.width == buf->vb.width && 1527 } else if (prev->vb.width == buf->vb.width &&
1529 prev->vb.height == buf->vb.height && 1528 prev->vb.height == buf->vb.height &&
1530 prev->fmt == buf->fmt) { 1529 prev->fmt == buf->fmt) {
1531 list_del(&buf->vb.queue); 1530 list_move_tail(&buf->vb.queue, &q->active);
1532 list_add_tail(&buf->vb.queue, &q->active);
1533 buf->vb.state = VIDEOBUF_ACTIVE; 1531 buf->vb.state = VIDEOBUF_ACTIVE;
1534 buf->count = q->count++; 1532 buf->count = q->count++;
1535 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); 1533 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
@@ -2088,8 +2086,8 @@ void cx23885_gpio_enable(struct cx23885_dev *dev, u32 mask, int asoutput)
2088 /* TODO: 23-19 */ 2086 /* TODO: 23-19 */
2089} 2087}
2090 2088
2091static int __devinit cx23885_initdev(struct pci_dev *pci_dev, 2089static int cx23885_initdev(struct pci_dev *pci_dev,
2092 const struct pci_device_id *pci_id) 2090 const struct pci_device_id *pci_id)
2093{ 2091{
2094 struct cx23885_dev *dev; 2092 struct cx23885_dev *dev;
2095 int err; 2093 int err;
@@ -2169,7 +2167,7 @@ fail_free:
2169 return err; 2167 return err;
2170} 2168}
2171 2169
2172static void __devexit cx23885_finidev(struct pci_dev *pci_dev) 2170static void cx23885_finidev(struct pci_dev *pci_dev)
2173{ 2171{
2174 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev); 2172 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev);
2175 struct cx23885_dev *dev = to_cx23885(v4l2_dev); 2173 struct cx23885_dev *dev = to_cx23885(v4l2_dev);
@@ -2212,7 +2210,7 @@ static struct pci_driver cx23885_pci_driver = {
2212 .name = "cx23885", 2210 .name = "cx23885",
2213 .id_table = cx23885_pci_tbl, 2211 .id_table = cx23885_pci_tbl,
2214 .probe = cx23885_initdev, 2212 .probe = cx23885_initdev,
2215 .remove = __devexit_p(cx23885_finidev), 2213 .remove = cx23885_finidev,
2216 /* TODO */ 2214 /* TODO */
2217 .suspend = NULL, 2215 .suspend = NULL,
2218 .resume = NULL, 2216 .resume = NULL,
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c
index 4379d8a6dad5..2f5b902e63ae 100644
--- a/drivers/media/pci/cx23885/cx23885-dvb.c
+++ b/drivers/media/pci/cx23885/cx23885-dvb.c
@@ -659,7 +659,7 @@ static struct mt2063_config terratec_mt2063_config[] = {
659 }, 659 },
660}; 660};
661 661
662int netup_altera_fpga_rw(void *device, int flag, int data, int read) 662static int netup_altera_fpga_rw(void *device, int flag, int data, int read)
663{ 663{
664 struct cx23885_dev *dev = (struct cx23885_dev *)device; 664 struct cx23885_dev *dev = (struct cx23885_dev *)device;
665 unsigned long timeout = jiffies + msecs_to_jiffies(1); 665 unsigned long timeout = jiffies + msecs_to_jiffies(1);
diff --git a/drivers/media/pci/cx23885/cx23885-f300.c b/drivers/media/pci/cx23885/cx23885-f300.c
index 93998f220986..5444cc526008 100644
--- a/drivers/media/pci/cx23885/cx23885-f300.c
+++ b/drivers/media/pci/cx23885/cx23885-f300.c
@@ -29,6 +29,7 @@
29 */ 29 */
30 30
31#include "cx23885.h" 31#include "cx23885.h"
32#include "cx23885-f300.h"
32 33
33#define F300_DATA GPIO_0 34#define F300_DATA GPIO_0
34#define F300_RESET GPIO_1 35#define F300_RESET GPIO_1
diff --git a/drivers/media/pci/cx23885/cx23885-input.c b/drivers/media/pci/cx23885/cx23885-input.c
index 2c925f77cf2a..4f1055a194b5 100644
--- a/drivers/media/pci/cx23885/cx23885-input.c
+++ b/drivers/media/pci/cx23885/cx23885-input.c
@@ -40,6 +40,7 @@
40#include <media/v4l2-subdev.h> 40#include <media/v4l2-subdev.h>
41 41
42#include "cx23885.h" 42#include "cx23885.h"
43#include "cx23885-input.h"
43 44
44#define MODULE_NAME "cx23885" 45#define MODULE_NAME "cx23885"
45 46
@@ -270,21 +271,21 @@ int cx23885_input_init(struct cx23885_dev *dev)
270 case CX23885_BOARD_HAUPPAUGE_HVR1250: 271 case CX23885_BOARD_HAUPPAUGE_HVR1250:
271 /* Integrated CX2388[58] IR controller */ 272 /* Integrated CX2388[58] IR controller */
272 driver_type = RC_DRIVER_IR_RAW; 273 driver_type = RC_DRIVER_IR_RAW;
273 allowed_protos = RC_TYPE_ALL; 274 allowed_protos = RC_BIT_ALL;
274 /* The grey Hauppauge RC-5 remote */ 275 /* The grey Hauppauge RC-5 remote */
275 rc_map = RC_MAP_HAUPPAUGE; 276 rc_map = RC_MAP_HAUPPAUGE;
276 break; 277 break;
277 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL: 278 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL:
278 /* Integrated CX23885 IR controller */ 279 /* Integrated CX23885 IR controller */
279 driver_type = RC_DRIVER_IR_RAW; 280 driver_type = RC_DRIVER_IR_RAW;
280 allowed_protos = RC_TYPE_NEC; 281 allowed_protos = RC_BIT_NEC;
281 /* The grey Terratec remote with orange buttons */ 282 /* The grey Terratec remote with orange buttons */
282 rc_map = RC_MAP_NEC_TERRATEC_CINERGY_XS; 283 rc_map = RC_MAP_NEC_TERRATEC_CINERGY_XS;
283 break; 284 break;
284 case CX23885_BOARD_TEVII_S470: 285 case CX23885_BOARD_TEVII_S470:
285 /* Integrated CX23885 IR controller */ 286 /* Integrated CX23885 IR controller */
286 driver_type = RC_DRIVER_IR_RAW; 287 driver_type = RC_DRIVER_IR_RAW;
287 allowed_protos = RC_TYPE_ALL; 288 allowed_protos = RC_BIT_ALL;
288 /* A guess at the remote */ 289 /* A guess at the remote */
289 rc_map = RC_MAP_TEVII_NEC; 290 rc_map = RC_MAP_TEVII_NEC;
290 break; 291 break;
diff --git a/drivers/media/pci/cx23885/cx23885-input.h b/drivers/media/pci/cx23885/cx23885-input.h
index 75ef15d3f523..87dc44e69977 100644
--- a/drivers/media/pci/cx23885/cx23885-input.h
+++ b/drivers/media/pci/cx23885/cx23885-input.h
@@ -23,7 +23,7 @@
23 23
24#ifndef _CX23885_INPUT_H_ 24#ifndef _CX23885_INPUT_H_
25#define _CX23885_INPUT_H_ 25#define _CX23885_INPUT_H_
26int cx23885_input_rx_work_handler(struct cx23885_dev *dev, u32 events); 26void cx23885_input_rx_work_handler(struct cx23885_dev *dev, u32 events);
27 27
28int cx23885_input_init(struct cx23885_dev *dev); 28int cx23885_input_init(struct cx23885_dev *dev);
29void cx23885_input_fini(struct cx23885_dev *dev); 29void cx23885_input_fini(struct cx23885_dev *dev);
diff --git a/drivers/media/pci/cx23885/cx23885-ioctl.c b/drivers/media/pci/cx23885/cx23885-ioctl.c
index 44812ca78899..ea9a614f3bbf 100644
--- a/drivers/media/pci/cx23885/cx23885-ioctl.c
+++ b/drivers/media/pci/cx23885/cx23885-ioctl.c
@@ -22,6 +22,8 @@
22 */ 22 */
23 23
24#include "cx23885.h" 24#include "cx23885.h"
25#include "cx23885-ioctl.h"
26
25#include <media/v4l2-chip-ident.h> 27#include <media/v4l2-chip-ident.h>
26 28
27int cx23885_g_chip_ident(struct file *file, void *fh, 29int cx23885_g_chip_ident(struct file *file, void *fh,
diff --git a/drivers/media/pci/cx23885/cx23885-ir.c b/drivers/media/pci/cx23885/cx23885-ir.c
index 7125247dd255..bfef19359291 100644
--- a/drivers/media/pci/cx23885/cx23885-ir.c
+++ b/drivers/media/pci/cx23885/cx23885-ir.c
@@ -24,6 +24,7 @@
24#include <media/v4l2-device.h> 24#include <media/v4l2-device.h>
25 25
26#include "cx23885.h" 26#include "cx23885.h"
27#include "cx23885-ir.h"
27#include "cx23885-input.h" 28#include "cx23885-input.h"
28 29
29#define CX23885_IR_RX_FIFO_SERVICE_REQ 0 30#define CX23885_IR_RX_FIFO_SERVICE_REQ 0
diff --git a/drivers/media/pci/cx23885/cx23888-ir.c b/drivers/media/pci/cx23885/cx23888-ir.c
index c2bc39c58f82..c4bd1e95d33f 100644
--- a/drivers/media/pci/cx23885/cx23888-ir.c
+++ b/drivers/media/pci/cx23885/cx23888-ir.c
@@ -29,6 +29,7 @@
29#include <media/rc-core.h> 29#include <media/rc-core.h>
30 30
31#include "cx23885.h" 31#include "cx23885.h"
32#include "cx23888-ir.h"
32 33
33static unsigned int ir_888_debug; 34static unsigned int ir_888_debug;
34module_param(ir_888_debug, int, 0644); 35module_param(ir_888_debug, int, 0644);
diff --git a/drivers/media/pci/cx23885/netup-init.c b/drivers/media/pci/cx23885/netup-init.c
index f4893e69cd89..0044fef7ca24 100644
--- a/drivers/media/pci/cx23885/netup-init.c
+++ b/drivers/media/pci/cx23885/netup-init.c
@@ -24,6 +24,7 @@
24 */ 24 */
25 25
26#include "cx23885.h" 26#include "cx23885.h"
27#include "netup-init.h"
27 28
28static void i2c_av_write(struct i2c_adapter *i2c, u16 reg, u8 val) 29static void i2c_av_write(struct i2c_adapter *i2c, u16 reg, u8 val)
29{ 30{
diff --git a/drivers/media/pci/cx25821/cx25821-audio-upstream.c b/drivers/media/pci/cx25821/cx25821-audio-upstream.c
index 8b2a99975c23..87491ca05ee5 100644
--- a/drivers/media/pci/cx25821/cx25821-audio-upstream.c
+++ b/drivers/media/pci/cx25821/cx25821-audio-upstream.c
@@ -44,7 +44,7 @@ MODULE_LICENSE("GPL");
44static int _intr_msk = FLD_AUD_SRC_RISCI1 | FLD_AUD_SRC_OF | 44static int _intr_msk = FLD_AUD_SRC_RISCI1 | FLD_AUD_SRC_OF |
45 FLD_AUD_SRC_SYNC | FLD_AUD_SRC_OPC_ERR; 45 FLD_AUD_SRC_SYNC | FLD_AUD_SRC_OPC_ERR;
46 46
47int cx25821_sram_channel_setup_upstream_audio(struct cx25821_dev *dev, 47static int cx25821_sram_channel_setup_upstream_audio(struct cx25821_dev *dev,
48 struct sram_channel *ch, 48 struct sram_channel *ch,
49 unsigned int bpl, u32 risc) 49 unsigned int bpl, u32 risc)
50{ 50{
@@ -133,7 +133,7 @@ static __le32 *cx25821_risc_field_upstream_audio(struct cx25821_dev *dev,
133 return rp; 133 return rp;
134} 134}
135 135
136int cx25821_risc_buffer_upstream_audio(struct cx25821_dev *dev, 136static int cx25821_risc_buffer_upstream_audio(struct cx25821_dev *dev,
137 struct pci_dev *pci, 137 struct pci_dev *pci,
138 unsigned int bpl, unsigned int lines) 138 unsigned int bpl, unsigned int lines)
139{ 139{
@@ -197,7 +197,7 @@ int cx25821_risc_buffer_upstream_audio(struct cx25821_dev *dev,
197 return 0; 197 return 0;
198} 198}
199 199
200void cx25821_free_memory_audio(struct cx25821_dev *dev) 200static void cx25821_free_memory_audio(struct cx25821_dev *dev)
201{ 201{
202 if (dev->_risc_virt_addr) { 202 if (dev->_risc_virt_addr) {
203 pci_free_consistent(dev->pci, dev->_audiorisc_size, 203 pci_free_consistent(dev->pci, dev->_audiorisc_size,
@@ -256,7 +256,7 @@ void cx25821_free_mem_upstream_audio(struct cx25821_dev *dev)
256 cx25821_free_memory_audio(dev); 256 cx25821_free_memory_audio(dev);
257} 257}
258 258
259int cx25821_get_audio_data(struct cx25821_dev *dev, 259static int cx25821_get_audio_data(struct cx25821_dev *dev,
260 struct sram_channel *sram_ch) 260 struct sram_channel *sram_ch)
261{ 261{
262 struct file *myfile; 262 struct file *myfile;
@@ -351,7 +351,7 @@ static void cx25821_audioups_handler(struct work_struct *work)
351 sram_channels); 351 sram_channels);
352} 352}
353 353
354int cx25821_openfile_audio(struct cx25821_dev *dev, 354static int cx25821_openfile_audio(struct cx25821_dev *dev,
355 struct sram_channel *sram_ch) 355 struct sram_channel *sram_ch)
356{ 356{
357 struct file *myfile; 357 struct file *myfile;
@@ -490,7 +490,7 @@ error:
490 return ret; 490 return ret;
491} 491}
492 492
493int cx25821_audio_upstream_irq(struct cx25821_dev *dev, int chan_num, 493static int cx25821_audio_upstream_irq(struct cx25821_dev *dev, int chan_num,
494 u32 status) 494 u32 status)
495{ 495{
496 int i = 0; 496 int i = 0;
@@ -634,8 +634,8 @@ static void cx25821_wait_fifo_enable(struct cx25821_dev *dev,
634 634
635} 635}
636 636
637int cx25821_start_audio_dma_upstream(struct cx25821_dev *dev, 637static int cx25821_start_audio_dma_upstream(struct cx25821_dev *dev,
638 struct sram_channel *sram_ch) 638 struct sram_channel *sram_ch)
639{ 639{
640 u32 tmp = 0; 640 u32 tmp = 0;
641 int err = 0; 641 int err = 0;
@@ -700,9 +700,7 @@ fail_irq:
700int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select) 700int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select)
701{ 701{
702 struct sram_channel *sram_ch; 702 struct sram_channel *sram_ch;
703 int retval = 0;
704 int err = 0; 703 int err = 0;
705 int str_length = 0;
706 704
707 if (dev->_audio_is_running) { 705 if (dev->_audio_is_running) {
708 pr_warn("Audio Channel is still running so return!\n"); 706 pr_warn("Audio Channel is still running so return!\n");
@@ -731,27 +729,29 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select)
731 _line_size = AUDIO_LINE_SIZE; 729 _line_size = AUDIO_LINE_SIZE;
732 730
733 if (dev->input_audiofilename) { 731 if (dev->input_audiofilename) {
734 str_length = strlen(dev->input_audiofilename); 732 dev->_audiofilename = kstrdup(dev->input_audiofilename,
735 dev->_audiofilename = kmemdup(dev->input_audiofilename, 733 GFP_KERNEL);
736 str_length + 1, GFP_KERNEL);
737 734
738 if (!dev->_audiofilename) 735 if (!dev->_audiofilename) {
736 err = -ENOMEM;
739 goto error; 737 goto error;
738 }
740 739
741 /* Default if filename is empty string */ 740 /* Default if filename is empty string */
742 if (strcmp(dev->input_audiofilename, "") == 0) 741 if (strcmp(dev->input_audiofilename, "") == 0)
743 dev->_audiofilename = "/root/audioGOOD.wav"; 742 dev->_audiofilename = "/root/audioGOOD.wav";
744 } else { 743 } else {
745 str_length = strlen(_defaultAudioName); 744 dev->_audiofilename = kstrdup(_defaultAudioName,
746 dev->_audiofilename = kmemdup(_defaultAudioName, 745 GFP_KERNEL);
747 str_length + 1, GFP_KERNEL);
748 746
749 if (!dev->_audiofilename) 747 if (!dev->_audiofilename) {
748 err = -ENOMEM;
750 goto error; 749 goto error;
750 }
751 } 751 }
752 752
753 retval = cx25821_sram_channel_setup_upstream_audio(dev, sram_ch, 753 cx25821_sram_channel_setup_upstream_audio(dev, sram_ch,
754 _line_size, 0); 754 _line_size, 0);
755 755
756 dev->audio_upstream_riscbuf_size = 756 dev->audio_upstream_riscbuf_size =
757 AUDIO_RISC_DMA_BUF_SIZE * NUM_AUDIO_PROGS + 757 AUDIO_RISC_DMA_BUF_SIZE * NUM_AUDIO_PROGS +
@@ -759,9 +759,9 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select)
759 dev->audio_upstream_databuf_size = AUDIO_DATA_BUF_SZ * NUM_AUDIO_PROGS; 759 dev->audio_upstream_databuf_size = AUDIO_DATA_BUF_SZ * NUM_AUDIO_PROGS;
760 760
761 /* Allocating buffers and prepare RISC program */ 761 /* Allocating buffers and prepare RISC program */
762 retval = cx25821_audio_upstream_buffer_prepare(dev, sram_ch, 762 err = cx25821_audio_upstream_buffer_prepare(dev, sram_ch,
763 _line_size); 763 _line_size);
764 if (retval < 0) { 764 if (err < 0) {
765 pr_err("%s: Failed to set up Audio upstream buffers!\n", 765 pr_err("%s: Failed to set up Audio upstream buffers!\n",
766 dev->name); 766 dev->name);
767 goto error; 767 goto error;
diff --git a/drivers/media/pci/cx25821/cx25821-biffuncs.h b/drivers/media/pci/cx25821/cx25821-biffuncs.h
index 9326a7c729ec..937f5a70fb7a 100644
--- a/drivers/media/pci/cx25821/cx25821-biffuncs.h
+++ b/drivers/media/pci/cx25821/cx25821-biffuncs.h
@@ -25,17 +25,17 @@
25 25
26#define SetBit(Bit) (1 << Bit) 26#define SetBit(Bit) (1 << Bit)
27 27
28inline u8 getBit(u32 sample, u8 index) 28static inline u8 getBit(u32 sample, u8 index)
29{ 29{
30 return (u8) ((sample >> index) & 1); 30 return (u8) ((sample >> index) & 1);
31} 31}
32 32
33inline u32 clearBitAtPos(u32 value, u8 bit) 33static inline u32 clearBitAtPos(u32 value, u8 bit)
34{ 34{
35 return value & ~(1 << bit); 35 return value & ~(1 << bit);
36} 36}
37 37
38inline u32 setBitAtPos(u32 sample, u8 bit) 38static inline u32 setBitAtPos(u32 sample, u8 bit)
39{ 39{
40 sample |= (1 << bit); 40 sample |= (1 << bit);
41 return sample; 41 return sample;
diff --git a/drivers/media/pci/cx25821/cx25821-core.c b/drivers/media/pci/cx25821/cx25821-core.c
index f11f6f07e915..1884e2cc35e9 100644
--- a/drivers/media/pci/cx25821/cx25821-core.c
+++ b/drivers/media/pci/cx25821/cx25821-core.c
@@ -1361,8 +1361,8 @@ struct cx25821_dev *cx25821_dev_get(struct pci_dev *pci)
1361} 1361}
1362EXPORT_SYMBOL(cx25821_dev_get); 1362EXPORT_SYMBOL(cx25821_dev_get);
1363 1363
1364static int __devinit cx25821_initdev(struct pci_dev *pci_dev, 1364static int cx25821_initdev(struct pci_dev *pci_dev,
1365 const struct pci_device_id *pci_id) 1365 const struct pci_device_id *pci_id)
1366{ 1366{
1367 struct cx25821_dev *dev; 1367 struct cx25821_dev *dev;
1368 int err = 0; 1368 int err = 0;
@@ -1433,7 +1433,7 @@ fail_free:
1433 return err; 1433 return err;
1434} 1434}
1435 1435
1436static void __devexit cx25821_finidev(struct pci_dev *pci_dev) 1436static void cx25821_finidev(struct pci_dev *pci_dev)
1437{ 1437{
1438 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev); 1438 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev);
1439 struct cx25821_dev *dev = get_cx25821(v4l2_dev); 1439 struct cx25821_dev *dev = get_cx25821(v4l2_dev);
@@ -1478,7 +1478,7 @@ static struct pci_driver cx25821_pci_driver = {
1478 .name = "cx25821", 1478 .name = "cx25821",
1479 .id_table = cx25821_pci_tbl, 1479 .id_table = cx25821_pci_tbl,
1480 .probe = cx25821_initdev, 1480 .probe = cx25821_initdev,
1481 .remove = __devexit_p(cx25821_finidev), 1481 .remove = cx25821_finidev,
1482 /* TODO */ 1482 /* TODO */
1483 .suspend = NULL, 1483 .suspend = NULL,
1484 .resume = NULL, 1484 .resume = NULL,
diff --git a/drivers/media/pci/cx25821/cx25821-i2c.c b/drivers/media/pci/cx25821/cx25821-i2c.c
index 9844549764c9..a8dc945bbe17 100644
--- a/drivers/media/pci/cx25821/cx25821-i2c.c
+++ b/drivers/media/pci/cx25821/cx25821-i2c.c
@@ -329,7 +329,8 @@ int cx25821_i2c_unregister(struct cx25821_i2c *bus)
329 return 0; 329 return 0;
330} 330}
331 331
332void cx25821_av_clk(struct cx25821_dev *dev, int enable) 332#if 0 /* Currently unused */
333static void cx25821_av_clk(struct cx25821_dev *dev, int enable)
333{ 334{
334 /* write 0 to bus 2 addr 0x144 via i2x_xfer() */ 335 /* write 0 to bus 2 addr 0x144 via i2x_xfer() */
335 char buffer[3]; 336 char buffer[3];
@@ -351,6 +352,7 @@ void cx25821_av_clk(struct cx25821_dev *dev, int enable)
351 352
352 i2c_xfer(&dev->i2c_bus[0].i2c_adap, &msg, 1); 353 i2c_xfer(&dev->i2c_bus[0].i2c_adap, &msg, 1);
353} 354}
355#endif
354 356
355int cx25821_i2c_read(struct cx25821_i2c *bus, u16 reg_addr, int *value) 357int cx25821_i2c_read(struct cx25821_i2c *bus, u16 reg_addr, int *value)
356{ 358{
diff --git a/drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c b/drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c
index d33fc1a23030..cf2723c7197f 100644
--- a/drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c
+++ b/drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c
@@ -123,10 +123,11 @@ static __le32 *cx25821_risc_field_upstream_ch2(struct cx25821_dev *dev,
123 return rp; 123 return rp;
124} 124}
125 125
126int cx25821_risc_buffer_upstream_ch2(struct cx25821_dev *dev, 126static int cx25821_risc_buffer_upstream_ch2(struct cx25821_dev *dev,
127 struct pci_dev *pci, 127 struct pci_dev *pci,
128 unsigned int top_offset, unsigned int bpl, 128 unsigned int top_offset,
129 unsigned int lines) 129 unsigned int bpl,
130 unsigned int lines)
130{ 131{
131 __le32 *rp; 132 __le32 *rp;
132 int fifo_enable = 0; 133 int fifo_enable = 0;
@@ -255,7 +256,8 @@ void cx25821_free_mem_upstream_ch2(struct cx25821_dev *dev)
255 } 256 }
256} 257}
257 258
258int cx25821_get_frame_ch2(struct cx25821_dev *dev, struct sram_channel *sram_ch) 259static int cx25821_get_frame_ch2(struct cx25821_dev *dev,
260 struct sram_channel *sram_ch)
259{ 261{
260 struct file *myfile; 262 struct file *myfile;
261 int frame_index_temp = dev->_frame_index_ch2; 263 int frame_index_temp = dev->_frame_index_ch2;
@@ -360,7 +362,8 @@ static void cx25821_vidups_handler_ch2(struct work_struct *work)
360 _channel2_upstream_select].sram_channels); 362 _channel2_upstream_select].sram_channels);
361} 363}
362 364
363int cx25821_openfile_ch2(struct cx25821_dev *dev, struct sram_channel *sram_ch) 365static int cx25821_openfile_ch2(struct cx25821_dev *dev,
366 struct sram_channel *sram_ch)
364{ 367{
365 struct file *myfile; 368 struct file *myfile;
366 int i = 0, j = 0; 369 int i = 0, j = 0;
@@ -507,8 +510,9 @@ error:
507 return ret; 510 return ret;
508} 511}
509 512
510int cx25821_video_upstream_irq_ch2(struct cx25821_dev *dev, int chan_num, 513static int cx25821_video_upstream_irq_ch2(struct cx25821_dev *dev,
511 u32 status) 514 int chan_num,
515 u32 status)
512{ 516{
513 u32 int_msk_tmp; 517 u32 int_msk_tmp;
514 struct sram_channel *channel = dev->channels[chan_num].sram_channels; 518 struct sram_channel *channel = dev->channels[chan_num].sram_channels;
@@ -647,8 +651,8 @@ static void cx25821_set_pixelengine_ch2(struct cx25821_dev *dev,
647 cx_write(ch->vid_cdt_size, VID_CDT_SIZE >> 3); 651 cx_write(ch->vid_cdt_size, VID_CDT_SIZE >> 3);
648} 652}
649 653
650int cx25821_start_video_dma_upstream_ch2(struct cx25821_dev *dev, 654static int cx25821_start_video_dma_upstream_ch2(struct cx25821_dev *dev,
651 struct sram_channel *sram_ch) 655 struct sram_channel *sram_ch)
652{ 656{
653 u32 tmp = 0; 657 u32 tmp = 0;
654 int err = 0; 658 int err = 0;
@@ -704,11 +708,9 @@ int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select,
704{ 708{
705 struct sram_channel *sram_ch; 709 struct sram_channel *sram_ch;
706 u32 tmp; 710 u32 tmp;
707 int retval = 0;
708 int err = 0; 711 int err = 0;
709 int data_frame_size = 0; 712 int data_frame_size = 0;
710 int risc_buffer_size = 0; 713 int risc_buffer_size = 0;
711 int str_length = 0;
712 714
713 if (dev->_is_running_ch2) { 715 if (dev->_is_running_ch2) {
714 pr_info("Video Channel is still running so return!\n"); 716 pr_info("Video Channel is still running so return!\n");
@@ -744,20 +746,16 @@ int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select,
744 risc_buffer_size = dev->_isNTSC_ch2 ? 746 risc_buffer_size = dev->_isNTSC_ch2 ?
745 NTSC_RISC_BUF_SIZE : PAL_RISC_BUF_SIZE; 747 NTSC_RISC_BUF_SIZE : PAL_RISC_BUF_SIZE;
746 748
747 if (dev->input_filename_ch2) { 749 if (dev->input_filename_ch2)
748 str_length = strlen(dev->input_filename_ch2); 750 dev->_filename_ch2 = kstrdup(dev->input_filename_ch2,
749 dev->_filename_ch2 = kmemdup(dev->input_filename_ch2, 751 GFP_KERNEL);
750 str_length + 1, GFP_KERNEL); 752 else
751 753 dev->_filename_ch2 = kstrdup(dev->_defaultname_ch2,
752 if (!dev->_filename_ch2) 754 GFP_KERNEL);
753 goto error;
754 } else {
755 str_length = strlen(dev->_defaultname_ch2);
756 dev->_filename_ch2 = kmemdup(dev->_defaultname_ch2,
757 str_length + 1, GFP_KERNEL);
758 755
759 if (!dev->_filename_ch2) 756 if (!dev->_filename_ch2) {
760 goto error; 757 err = -ENOENT;
758 goto error;
761 } 759 }
762 760
763 /* Default if filename is empty string */ 761 /* Default if filename is empty string */
@@ -773,7 +771,7 @@ int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select,
773 } 771 }
774 } 772 }
775 773
776 retval = cx25821_sram_channel_setup_upstream(dev, sram_ch, 774 err = cx25821_sram_channel_setup_upstream(dev, sram_ch,
777 dev->_line_size_ch2, 0); 775 dev->_line_size_ch2, 0);
778 776
779 /* setup fifo + format */ 777 /* setup fifo + format */
@@ -783,9 +781,9 @@ int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select,
783 dev->upstream_databuf_size_ch2 = data_frame_size * 2; 781 dev->upstream_databuf_size_ch2 = data_frame_size * 2;
784 782
785 /* Allocating buffers and prepare RISC program */ 783 /* Allocating buffers and prepare RISC program */
786 retval = cx25821_upstream_buffer_prepare_ch2(dev, sram_ch, 784 err = cx25821_upstream_buffer_prepare_ch2(dev, sram_ch,
787 dev->_line_size_ch2); 785 dev->_line_size_ch2);
788 if (retval < 0) { 786 if (err < 0) {
789 pr_err("%s: Failed to set up Video upstream buffers!\n", 787 pr_err("%s: Failed to set up Video upstream buffers!\n",
790 dev->name); 788 dev->name);
791 goto error; 789 goto error;
diff --git a/drivers/media/pci/cx25821/cx25821-video-upstream.c b/drivers/media/pci/cx25821/cx25821-video-upstream.c
index 6759fff8eb64..7fc97110d973 100644
--- a/drivers/media/pci/cx25821/cx25821-video-upstream.c
+++ b/drivers/media/pci/cx25821/cx25821-video-upstream.c
@@ -173,10 +173,10 @@ static __le32 *cx25821_risc_field_upstream(struct cx25821_dev *dev, __le32 * rp,
173 return rp; 173 return rp;
174} 174}
175 175
176int cx25821_risc_buffer_upstream(struct cx25821_dev *dev, 176static int cx25821_risc_buffer_upstream(struct cx25821_dev *dev,
177 struct pci_dev *pci, 177 struct pci_dev *pci,
178 unsigned int top_offset, 178 unsigned int top_offset,
179 unsigned int bpl, unsigned int lines) 179 unsigned int bpl, unsigned int lines)
180{ 180{
181 __le32 *rp; 181 __le32 *rp;
182 int fifo_enable = 0; 182 int fifo_enable = 0;
@@ -300,7 +300,8 @@ void cx25821_free_mem_upstream_ch1(struct cx25821_dev *dev)
300 } 300 }
301} 301}
302 302
303int cx25821_get_frame(struct cx25821_dev *dev, struct sram_channel *sram_ch) 303static int cx25821_get_frame(struct cx25821_dev *dev,
304 struct sram_channel *sram_ch)
304{ 305{
305 struct file *myfile; 306 struct file *myfile;
306 int frame_index_temp = dev->_frame_index; 307 int frame_index_temp = dev->_frame_index;
@@ -405,7 +406,8 @@ static void cx25821_vidups_handler(struct work_struct *work)
405 sram_channels); 406 sram_channels);
406} 407}
407 408
408int cx25821_openfile(struct cx25821_dev *dev, struct sram_channel *sram_ch) 409static int cx25821_openfile(struct cx25821_dev *dev,
410 struct sram_channel *sram_ch)
409{ 411{
410 struct file *myfile; 412 struct file *myfile;
411 int i = 0, j = 0; 413 int i = 0, j = 0;
@@ -486,8 +488,9 @@ int cx25821_openfile(struct cx25821_dev *dev, struct sram_channel *sram_ch)
486 return 0; 488 return 0;
487} 489}
488 490
489int cx25821_upstream_buffer_prepare(struct cx25821_dev *dev, 491static int cx25821_upstream_buffer_prepare(struct cx25821_dev *dev,
490 struct sram_channel *sram_ch, int bpl) 492 struct sram_channel *sram_ch,
493 int bpl)
491{ 494{
492 int ret = 0; 495 int ret = 0;
493 dma_addr_t dma_addr; 496 dma_addr_t dma_addr;
@@ -548,8 +551,8 @@ error:
548 return ret; 551 return ret;
549} 552}
550 553
551int cx25821_video_upstream_irq(struct cx25821_dev *dev, int chan_num, 554static int cx25821_video_upstream_irq(struct cx25821_dev *dev, int chan_num,
552 u32 status) 555 u32 status)
553{ 556{
554 u32 int_msk_tmp; 557 u32 int_msk_tmp;
555 struct sram_channel *channel = dev->channels[chan_num].sram_channels; 558 struct sram_channel *channel = dev->channels[chan_num].sram_channels;
@@ -664,8 +667,9 @@ static irqreturn_t cx25821_upstream_irq(int irq, void *dev_id)
664 return IRQ_RETVAL(handled); 667 return IRQ_RETVAL(handled);
665} 668}
666 669
667void cx25821_set_pixelengine(struct cx25821_dev *dev, struct sram_channel *ch, 670static void cx25821_set_pixelengine(struct cx25821_dev *dev,
668 int pix_format) 671 struct sram_channel *ch,
672 int pix_format)
669{ 673{
670 int width = WIDTH_D1; 674 int width = WIDTH_D1;
671 int height = dev->_lines_count; 675 int height = dev->_lines_count;
@@ -696,8 +700,8 @@ void cx25821_set_pixelengine(struct cx25821_dev *dev, struct sram_channel *ch,
696 cx_write(ch->vid_cdt_size, VID_CDT_SIZE >> 3); 700 cx_write(ch->vid_cdt_size, VID_CDT_SIZE >> 3);
697} 701}
698 702
699int cx25821_start_video_dma_upstream(struct cx25821_dev *dev, 703static int cx25821_start_video_dma_upstream(struct cx25821_dev *dev,
700 struct sram_channel *sram_ch) 704 struct sram_channel *sram_ch)
701{ 705{
702 u32 tmp = 0; 706 u32 tmp = 0;
703 int err = 0; 707 int err = 0;
@@ -753,7 +757,6 @@ int cx25821_vidupstream_init_ch1(struct cx25821_dev *dev, int channel_select,
753{ 757{
754 struct sram_channel *sram_ch; 758 struct sram_channel *sram_ch;
755 u32 tmp; 759 u32 tmp;
756 int retval = 0;
757 int err = 0; 760 int err = 0;
758 int data_frame_size = 0; 761 int data_frame_size = 0;
759 int risc_buffer_size = 0; 762 int risc_buffer_size = 0;
@@ -796,15 +799,19 @@ int cx25821_vidupstream_init_ch1(struct cx25821_dev *dev, int channel_select,
796 dev->_filename = kmemdup(dev->input_filename, str_length + 1, 799 dev->_filename = kmemdup(dev->input_filename, str_length + 1,
797 GFP_KERNEL); 800 GFP_KERNEL);
798 801
799 if (!dev->_filename) 802 if (!dev->_filename) {
803 err = -ENOENT;
800 goto error; 804 goto error;
805 }
801 } else { 806 } else {
802 str_length = strlen(dev->_defaultname); 807 str_length = strlen(dev->_defaultname);
803 dev->_filename = kmemdup(dev->_defaultname, str_length + 1, 808 dev->_filename = kmemdup(dev->_defaultname, str_length + 1,
804 GFP_KERNEL); 809 GFP_KERNEL);
805 810
806 if (!dev->_filename) 811 if (!dev->_filename) {
812 err = -ENOENT;
807 goto error; 813 goto error;
814 }
808 } 815 }
809 816
810 /* Default if filename is empty string */ 817 /* Default if filename is empty string */
@@ -828,7 +835,7 @@ int cx25821_vidupstream_init_ch1(struct cx25821_dev *dev, int channel_select,
828 dev->_line_size = (dev->_pixel_format == PIXEL_FRMT_422) ? 835 dev->_line_size = (dev->_pixel_format == PIXEL_FRMT_422) ?
829 (WIDTH_D1 * 2) : (WIDTH_D1 * 3) / 2; 836 (WIDTH_D1 * 2) : (WIDTH_D1 * 3) / 2;
830 837
831 retval = cx25821_sram_channel_setup_upstream(dev, sram_ch, 838 err = cx25821_sram_channel_setup_upstream(dev, sram_ch,
832 dev->_line_size, 0); 839 dev->_line_size, 0);
833 840
834 /* setup fifo + format */ 841 /* setup fifo + format */
@@ -838,8 +845,8 @@ int cx25821_vidupstream_init_ch1(struct cx25821_dev *dev, int channel_select,
838 dev->upstream_databuf_size = data_frame_size * 2; 845 dev->upstream_databuf_size = data_frame_size * 2;
839 846
840 /* Allocating buffers and prepare RISC program */ 847 /* Allocating buffers and prepare RISC program */
841 retval = cx25821_upstream_buffer_prepare(dev, sram_ch, dev->_line_size); 848 err = cx25821_upstream_buffer_prepare(dev, sram_ch, dev->_line_size);
842 if (retval < 0) { 849 if (err < 0) {
843 pr_err("%s: Failed to set up Video upstream buffers!\n", 850 pr_err("%s: Failed to set up Video upstream buffers!\n",
844 dev->name); 851 dev->name);
845 goto error; 852 goto error;
diff --git a/drivers/media/pci/cx25821/cx25821-video.c b/drivers/media/pci/cx25821/cx25821-video.c
index 0a80245165d0..53b16dd70320 100644
--- a/drivers/media/pci/cx25821/cx25821-video.c
+++ b/drivers/media/pci/cx25821/cx25821-video.c
@@ -291,9 +291,9 @@ int cx25821_start_video_dma(struct cx25821_dev *dev,
291 return 0; 291 return 0;
292} 292}
293 293
294int cx25821_restart_video_queue(struct cx25821_dev *dev, 294static int cx25821_restart_video_queue(struct cx25821_dev *dev,
295 struct cx25821_dmaqueue *q, 295 struct cx25821_dmaqueue *q,
296 struct sram_channel *channel) 296 struct sram_channel *channel)
297{ 297{
298 struct cx25821_buffer *buf, *prev; 298 struct cx25821_buffer *buf, *prev;
299 struct list_head *item; 299 struct list_head *item;
@@ -342,7 +342,7 @@ int cx25821_restart_video_queue(struct cx25821_dev *dev,
342 } 342 }
343} 343}
344 344
345void cx25821_vid_timeout(unsigned long data) 345static void cx25821_vid_timeout(unsigned long data)
346{ 346{
347 struct cx25821_data *timeout_data = (struct cx25821_data *)data; 347 struct cx25821_data *timeout_data = (struct cx25821_data *)data;
348 struct cx25821_dev *dev = timeout_data->dev; 348 struct cx25821_dev *dev = timeout_data->dev;
diff --git a/drivers/media/pci/cx88/cx88-alsa.c b/drivers/media/pci/cx88/cx88-alsa.c
index 3aa6856ead3b..27d62623274b 100644
--- a/drivers/media/pci/cx88/cx88-alsa.c
+++ b/drivers/media/pci/cx88/cx88-alsa.c
@@ -45,11 +45,15 @@
45#include "cx88.h" 45#include "cx88.h"
46#include "cx88-reg.h" 46#include "cx88-reg.h"
47 47
48#define dprintk(level,fmt, arg...) if (debug >= level) \ 48#define dprintk(level, fmt, arg...) do { \
49 printk(KERN_INFO "%s/1: " fmt, chip->core->name , ## arg) 49 if (debug + 1 > level) \
50 printk(KERN_INFO "%s/1: " fmt, chip->core->name , ## arg);\
51} while(0)
50 52
51#define dprintk_core(level,fmt, arg...) if (debug >= level) \ 53#define dprintk_core(level, fmt, arg...) do { \
52 printk(KERN_DEBUG "%s/1: " fmt, chip->core->name , ## arg) 54 if (debug + 1 > level) \
55 printk(KERN_DEBUG "%s/1: " fmt, chip->core->name , ## arg);\
56} while(0)
53 57
54/**************************************************************************** 58/****************************************************************************
55 Data type declarations - Can be moded to a header file later 59 Data type declarations - Can be moded to a header file later
@@ -536,7 +540,7 @@ static struct snd_pcm_ops snd_cx88_pcm_ops = {
536/* 540/*
537 * create a PCM device 541 * create a PCM device
538 */ 542 */
539static int __devinit snd_cx88_pcm(snd_cx88_card_t *chip, int device, const char *name) 543static int snd_cx88_pcm(snd_cx88_card_t *chip, int device, const char *name)
540{ 544{
541 int err; 545 int err;
542 struct snd_pcm *pcm; 546 struct snd_pcm *pcm;
@@ -749,7 +753,7 @@ static struct snd_kcontrol_new snd_cx88_alc_switch = {
749 * Only boards with eeprom and byte 1 at eeprom=1 have it 753 * Only boards with eeprom and byte 1 at eeprom=1 have it
750 */ 754 */
751 755
752static const struct pci_device_id cx88_audio_pci_tbl[] __devinitdata = { 756static const struct pci_device_id cx88_audio_pci_tbl[] = {
753 {0x14f1,0x8801,PCI_ANY_ID,PCI_ANY_ID,0,0,0}, 757 {0x14f1,0x8801,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
754 {0x14f1,0x8811,PCI_ANY_ID,PCI_ANY_ID,0,0,0}, 758 {0x14f1,0x8811,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
755 {0, } 759 {0, }
@@ -788,10 +792,9 @@ static void snd_cx88_dev_free(struct snd_card * card)
788 */ 792 */
789 793
790static int devno; 794static int devno;
791static int __devinit snd_cx88_create(struct snd_card *card, 795static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci,
792 struct pci_dev *pci, 796 snd_cx88_card_t **rchip,
793 snd_cx88_card_t **rchip, 797 struct cx88_core **core_ptr)
794 struct cx88_core **core_ptr)
795{ 798{
796 snd_cx88_card_t *chip; 799 snd_cx88_card_t *chip;
797 struct cx88_core *core; 800 struct cx88_core *core;
@@ -858,8 +861,8 @@ static int __devinit snd_cx88_create(struct snd_card *card,
858 return 0; 861 return 0;
859} 862}
860 863
861static int __devinit cx88_audio_initdev(struct pci_dev *pci, 864static int cx88_audio_initdev(struct pci_dev *pci,
862 const struct pci_device_id *pci_id) 865 const struct pci_device_id *pci_id)
863{ 866{
864 struct snd_card *card; 867 struct snd_card *card;
865 snd_cx88_card_t *chip; 868 snd_cx88_card_t *chip;
@@ -927,7 +930,7 @@ error:
927/* 930/*
928 * ALSA destructor 931 * ALSA destructor
929 */ 932 */
930static void __devexit cx88_audio_finidev(struct pci_dev *pci) 933static void cx88_audio_finidev(struct pci_dev *pci)
931{ 934{
932 struct cx88_audio_dev *card = pci_get_drvdata(pci); 935 struct cx88_audio_dev *card = pci_get_drvdata(pci);
933 936
@@ -946,7 +949,7 @@ static struct pci_driver cx88_audio_pci_driver = {
946 .name = "cx88_audio", 949 .name = "cx88_audio",
947 .id_table = cx88_audio_pci_tbl, 950 .id_table = cx88_audio_pci_tbl,
948 .probe = cx88_audio_initdev, 951 .probe = cx88_audio_initdev,
949 .remove = __devexit_p(cx88_audio_finidev), 952 .remove = cx88_audio_finidev,
950}; 953};
951 954
952/**************************************************************************** 955/****************************************************************************
diff --git a/drivers/media/pci/cx88/cx88-blackbird.c b/drivers/media/pci/cx88/cx88-blackbird.c
index 62184eb919e5..a6ff8a6f4fc0 100644
--- a/drivers/media/pci/cx88/cx88-blackbird.c
+++ b/drivers/media/pci/cx88/cx88-blackbird.c
@@ -53,9 +53,10 @@ static unsigned int debug;
53module_param(debug,int,0644); 53module_param(debug,int,0644);
54MODULE_PARM_DESC(debug,"enable debug messages [blackbird]"); 54MODULE_PARM_DESC(debug,"enable debug messages [blackbird]");
55 55
56#define dprintk(level,fmt, arg...) if (debug >= level) \ 56#define dprintk(level, fmt, arg...) do { \
57 printk(KERN_DEBUG "%s/2-bb: " fmt, dev->core->name , ## arg) 57 if (debug + 1 > level) \
58 58 printk(KERN_DEBUG "%s/2-bb: " fmt, dev->core->name , ## arg); \
59} while(0)
59 60
60/* ------------------------------------------------------------------ */ 61/* ------------------------------------------------------------------ */
61 62
diff --git a/drivers/media/pci/cx88/cx88-core.c b/drivers/media/pci/cx88/cx88-core.c
index c97b174be3ab..19a58754c6e1 100644
--- a/drivers/media/pci/cx88/cx88-core.c
+++ b/drivers/media/pci/cx88/cx88-core.c
@@ -646,22 +646,22 @@ int cx88_reset(struct cx88_core *core)
646 646
647/* ------------------------------------------------------------------ */ 647/* ------------------------------------------------------------------ */
648 648
649static unsigned int inline norm_swidth(v4l2_std_id norm) 649static inline unsigned int norm_swidth(v4l2_std_id norm)
650{ 650{
651 return (norm & (V4L2_STD_MN & ~V4L2_STD_PAL_Nc)) ? 754 : 922; 651 return (norm & (V4L2_STD_MN & ~V4L2_STD_PAL_Nc)) ? 754 : 922;
652} 652}
653 653
654static unsigned int inline norm_hdelay(v4l2_std_id norm) 654static inline unsigned int norm_hdelay(v4l2_std_id norm)
655{ 655{
656 return (norm & (V4L2_STD_MN & ~V4L2_STD_PAL_Nc)) ? 135 : 186; 656 return (norm & (V4L2_STD_MN & ~V4L2_STD_PAL_Nc)) ? 135 : 186;
657} 657}
658 658
659static unsigned int inline norm_vdelay(v4l2_std_id norm) 659static inline unsigned int norm_vdelay(v4l2_std_id norm)
660{ 660{
661 return (norm & V4L2_STD_625_50) ? 0x24 : 0x18; 661 return (norm & V4L2_STD_625_50) ? 0x24 : 0x18;
662} 662}
663 663
664static unsigned int inline norm_fsc8(v4l2_std_id norm) 664static inline unsigned int norm_fsc8(v4l2_std_id norm)
665{ 665{
666 if (norm & V4L2_STD_PAL_M) 666 if (norm & V4L2_STD_PAL_M)
667 return 28604892; // 3.575611 MHz 667 return 28604892; // 3.575611 MHz
@@ -681,7 +681,7 @@ static unsigned int inline norm_fsc8(v4l2_std_id norm)
681 return 35468950; // 4.43361875 MHz +/- 5 Hz 681 return 35468950; // 4.43361875 MHz +/- 5 Hz
682} 682}
683 683
684static unsigned int inline norm_htotal(v4l2_std_id norm) 684static inline unsigned int norm_htotal(v4l2_std_id norm)
685{ 685{
686 686
687 unsigned int fsc4=norm_fsc8(norm)/2; 687 unsigned int fsc4=norm_fsc8(norm)/2;
@@ -692,7 +692,7 @@ static unsigned int inline norm_htotal(v4l2_std_id norm)
692 ((fsc4+262)/525*1001+15000)/30000; 692 ((fsc4+262)/525*1001+15000)/30000;
693} 693}
694 694
695static unsigned int inline norm_vbipack(v4l2_std_id norm) 695static inline unsigned int norm_vbipack(v4l2_std_id norm)
696{ 696{
697 return (norm & V4L2_STD_625_50) ? 511 : 400; 697 return (norm & V4L2_STD_625_50) ? 511 : 400;
698} 698}
diff --git a/drivers/media/pci/cx88/cx88-input.c b/drivers/media/pci/cx88/cx88-input.c
index ebf448c48ca3..f29e18c72f44 100644
--- a/drivers/media/pci/cx88/cx88-input.c
+++ b/drivers/media/pci/cx88/cx88-input.c
@@ -248,7 +248,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
248 struct cx88_IR *ir; 248 struct cx88_IR *ir;
249 struct rc_dev *dev; 249 struct rc_dev *dev;
250 char *ir_codes = NULL; 250 char *ir_codes = NULL;
251 u64 rc_type = RC_TYPE_OTHER; 251 u64 rc_type = RC_BIT_OTHER;
252 int err = -ENOMEM; 252 int err = -ENOMEM;
253 u32 hardware_mask = 0; /* For devices with a hardware mask, when 253 u32 hardware_mask = 0; /* For devices with a hardware mask, when
254 * used with a full-code IR table 254 * used with a full-code IR table
@@ -416,7 +416,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
416 break; 416 break;
417 case CX88_BOARD_TWINHAN_VP1027_DVBS: 417 case CX88_BOARD_TWINHAN_VP1027_DVBS:
418 ir_codes = RC_MAP_TWINHAN_VP1027_DVBS; 418 ir_codes = RC_MAP_TWINHAN_VP1027_DVBS;
419 rc_type = RC_TYPE_NEC; 419 rc_type = RC_BIT_NEC;
420 ir->sampling = 0xff00; /* address */ 420 ir->sampling = 0xff00; /* address */
421 break; 421 break;
422 } 422 }
@@ -592,7 +592,7 @@ void cx88_i2c_init_ir(struct cx88_core *core)
592 case CX88_BOARD_LEADTEK_PVR2000: 592 case CX88_BOARD_LEADTEK_PVR2000:
593 addr_list = pvr2000_addr_list; 593 addr_list = pvr2000_addr_list;
594 core->init_data.name = "cx88 Leadtek PVR 2000 remote"; 594 core->init_data.name = "cx88 Leadtek PVR 2000 remote";
595 core->init_data.type = RC_TYPE_UNKNOWN; 595 core->init_data.type = RC_BIT_UNKNOWN;
596 core->init_data.get_key = get_key_pvr2000; 596 core->init_data.get_key = get_key_pvr2000;
597 core->init_data.ir_codes = RC_MAP_EMPTY; 597 core->init_data.ir_codes = RC_MAP_EMPTY;
598 break; 598 break;
@@ -613,7 +613,7 @@ void cx88_i2c_init_ir(struct cx88_core *core)
613 /* Hauppauge XVR */ 613 /* Hauppauge XVR */
614 core->init_data.name = "cx88 Hauppauge XVR remote"; 614 core->init_data.name = "cx88 Hauppauge XVR remote";
615 core->init_data.ir_codes = RC_MAP_HAUPPAUGE; 615 core->init_data.ir_codes = RC_MAP_HAUPPAUGE;
616 core->init_data.type = RC_TYPE_RC5; 616 core->init_data.type = RC_BIT_RC5;
617 core->init_data.internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; 617 core->init_data.internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
618 618
619 info.platform_data = &core->init_data; 619 info.platform_data = &core->init_data;
diff --git a/drivers/media/pci/cx88/cx88-mpeg.c b/drivers/media/pci/cx88/cx88-mpeg.c
index d154bc197356..c9d3182f79d5 100644
--- a/drivers/media/pci/cx88/cx88-mpeg.c
+++ b/drivers/media/pci/cx88/cx88-mpeg.c
@@ -45,11 +45,15 @@ static unsigned int debug;
45module_param(debug,int,0644); 45module_param(debug,int,0644);
46MODULE_PARM_DESC(debug,"enable debug messages [mpeg]"); 46MODULE_PARM_DESC(debug,"enable debug messages [mpeg]");
47 47
48#define dprintk(level,fmt, arg...) if (debug >= level) \ 48#define dprintk(level, fmt, arg...) do { \
49 printk(KERN_DEBUG "%s/2-mpeg: " fmt, dev->core->name, ## arg) 49 if (debug + 1 > level) \
50 printk(KERN_DEBUG "%s/2-mpeg: " fmt, dev->core->name, ## arg); \
51} while(0)
50 52
51#define mpeg_dbg(level,fmt, arg...) if (debug >= level) \ 53#define mpeg_dbg(level, fmt, arg...) do { \
52 printk(KERN_DEBUG "%s/2-mpeg: " fmt, core->name, ## arg) 54 if (debug + 1 > level) \
55 printk(KERN_DEBUG "%s/2-mpeg: " fmt, core->name, ## arg); \
56} while(0)
53 57
54#if defined(CONFIG_MODULES) && defined(MODULE) 58#if defined(CONFIG_MODULES) && defined(MODULE)
55static void request_module_async(struct work_struct *work) 59static void request_module_async(struct work_struct *work)
@@ -217,8 +221,7 @@ static int cx8802_restart_queue(struct cx8802_dev *dev,
217 return 0; 221 return 0;
218 buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue); 222 buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue);
219 if (NULL == prev) { 223 if (NULL == prev) {
220 list_del(&buf->vb.queue); 224 list_move_tail(&buf->vb.queue, &q->active);
221 list_add_tail(&buf->vb.queue,&q->active);
222 cx8802_start_dma(dev, q, buf); 225 cx8802_start_dma(dev, q, buf);
223 buf->vb.state = VIDEOBUF_ACTIVE; 226 buf->vb.state = VIDEOBUF_ACTIVE;
224 buf->count = q->count++; 227 buf->count = q->count++;
@@ -229,8 +232,7 @@ static int cx8802_restart_queue(struct cx8802_dev *dev,
229 } else if (prev->vb.width == buf->vb.width && 232 } else if (prev->vb.width == buf->vb.width &&
230 prev->vb.height == buf->vb.height && 233 prev->vb.height == buf->vb.height &&
231 prev->fmt == buf->fmt) { 234 prev->fmt == buf->fmt) {
232 list_del(&buf->vb.queue); 235 list_move_tail(&buf->vb.queue, &q->active);
233 list_add_tail(&buf->vb.queue,&q->active);
234 buf->vb.state = VIDEOBUF_ACTIVE; 236 buf->vb.state = VIDEOBUF_ACTIVE;
235 buf->count = q->count++; 237 buf->count = q->count++;
236 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); 238 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
@@ -789,8 +791,8 @@ int cx8802_unregister_driver(struct cx8802_driver *drv)
789} 791}
790 792
791/* ----------------------------------------------------------- */ 793/* ----------------------------------------------------------- */
792static int __devinit cx8802_probe(struct pci_dev *pci_dev, 794static int cx8802_probe(struct pci_dev *pci_dev,
793 const struct pci_device_id *pci_id) 795 const struct pci_device_id *pci_id)
794{ 796{
795 struct cx8802_dev *dev; 797 struct cx8802_dev *dev;
796 struct cx88_core *core; 798 struct cx88_core *core;
@@ -838,7 +840,7 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev,
838 return err; 840 return err;
839} 841}
840 842
841static void __devexit cx8802_remove(struct pci_dev *pci_dev) 843static void cx8802_remove(struct pci_dev *pci_dev)
842{ 844{
843 struct cx8802_dev *dev; 845 struct cx8802_dev *dev;
844 846
@@ -896,7 +898,7 @@ static struct pci_driver cx8802_pci_driver = {
896 .name = "cx88-mpeg driver manager", 898 .name = "cx88-mpeg driver manager",
897 .id_table = cx8802_pci_tbl, 899 .id_table = cx8802_pci_tbl,
898 .probe = cx8802_probe, 900 .probe = cx8802_probe,
899 .remove = __devexit_p(cx8802_remove), 901 .remove = cx8802_remove,
900}; 902};
901 903
902static int __init cx8802_init(void) 904static int __init cx8802_init(void)
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c
index 05171457bf28..bc78354262ac 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -1696,8 +1696,8 @@ static void cx8800_unregister_video(struct cx8800_dev *dev)
1696 } 1696 }
1697} 1697}
1698 1698
1699static int __devinit cx8800_initdev(struct pci_dev *pci_dev, 1699static int cx8800_initdev(struct pci_dev *pci_dev,
1700 const struct pci_device_id *pci_id) 1700 const struct pci_device_id *pci_id)
1701{ 1701{
1702 struct cx8800_dev *dev; 1702 struct cx8800_dev *dev;
1703 struct cx88_core *core; 1703 struct cx88_core *core;
@@ -1923,7 +1923,7 @@ fail_free:
1923 return err; 1923 return err;
1924} 1924}
1925 1925
1926static void __devexit cx8800_finidev(struct pci_dev *pci_dev) 1926static void cx8800_finidev(struct pci_dev *pci_dev)
1927{ 1927{
1928 struct cx8800_dev *dev = pci_get_drvdata(pci_dev); 1928 struct cx8800_dev *dev = pci_get_drvdata(pci_dev);
1929 struct cx88_core *core = dev->core; 1929 struct cx88_core *core = dev->core;
@@ -2052,7 +2052,7 @@ static struct pci_driver cx8800_pci_driver = {
2052 .name = "cx8800", 2052 .name = "cx8800",
2053 .id_table = cx8800_pci_tbl, 2053 .id_table = cx8800_pci_tbl,
2054 .probe = cx8800_initdev, 2054 .probe = cx8800_initdev,
2055 .remove = __devexit_p(cx8800_finidev), 2055 .remove = cx8800_finidev,
2056#ifdef CONFIG_PM 2056#ifdef CONFIG_PM
2057 .suspend = cx8800_suspend, 2057 .suspend = cx8800_suspend,
2058 .resume = cx8800_resume, 2058 .resume = cx8800_resume,
diff --git a/drivers/media/pci/cx88/cx88.h b/drivers/media/pci/cx88/cx88.h
index 44ffc8b3d45f..ba0dba4a4d22 100644
--- a/drivers/media/pci/cx88/cx88.h
+++ b/drivers/media/pci/cx88/cx88.h
@@ -94,13 +94,13 @@ enum cx8802_board_access {
94/* ----------------------------------------------------------- */ 94/* ----------------------------------------------------------- */
95/* tv norms */ 95/* tv norms */
96 96
97static unsigned int inline norm_maxw(v4l2_std_id norm) 97static inline unsigned int norm_maxw(v4l2_std_id norm)
98{ 98{
99 return (norm & (V4L2_STD_MN & ~V4L2_STD_PAL_Nc)) ? 720 : 768; 99 return (norm & (V4L2_STD_MN & ~V4L2_STD_PAL_Nc)) ? 720 : 768;
100} 100}
101 101
102 102
103static unsigned int inline norm_maxh(v4l2_std_id norm) 103static inline unsigned int norm_maxh(v4l2_std_id norm)
104{ 104{
105 return (norm & V4L2_STD_625_50) ? 576 : 480; 105 return (norm & V4L2_STD_625_50) ? 576 : 480;
106} 106}
diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c
index feff57ee5a08..36e34522b9a8 100644
--- a/drivers/media/pci/ddbridge/ddbridge-core.c
+++ b/drivers/media/pci/ddbridge/ddbridge-core.c
@@ -1542,7 +1542,7 @@ static void ddb_unmap(struct ddb *dev)
1542} 1542}
1543 1543
1544 1544
1545static void __devexit ddb_remove(struct pci_dev *pdev) 1545static void ddb_remove(struct pci_dev *pdev)
1546{ 1546{
1547 struct ddb *dev = (struct ddb *) pci_get_drvdata(pdev); 1547 struct ddb *dev = (struct ddb *) pci_get_drvdata(pdev);
1548 1548
@@ -1565,8 +1565,7 @@ static void __devexit ddb_remove(struct pci_dev *pdev)
1565} 1565}
1566 1566
1567 1567
1568static int __devinit ddb_probe(struct pci_dev *pdev, 1568static int ddb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1569 const struct pci_device_id *id)
1570{ 1569{
1571 struct ddb *dev; 1570 struct ddb *dev;
1572 int stat = 0; 1571 int stat = 0;
@@ -1679,7 +1678,7 @@ static struct ddb_info ddb_v6 = {
1679 .subvendor = _subvend, .subdevice = _subdev, \ 1678 .subvendor = _subvend, .subdevice = _subdev, \
1680 .driver_data = (unsigned long)&_driverdata } 1679 .driver_data = (unsigned long)&_driverdata }
1681 1680
1682static const struct pci_device_id ddb_id_tbl[] __devinitdata = { 1681static const struct pci_device_id ddb_id_tbl[] = {
1683 DDB_ID(DDVID, 0x0002, DDVID, 0x0001, ddb_octopus), 1682 DDB_ID(DDVID, 0x0002, DDVID, 0x0001, ddb_octopus),
1684 DDB_ID(DDVID, 0x0003, DDVID, 0x0001, ddb_octopus), 1683 DDB_ID(DDVID, 0x0003, DDVID, 0x0001, ddb_octopus),
1685 DDB_ID(DDVID, 0x0003, DDVID, 0x0002, ddb_octopus_le), 1684 DDB_ID(DDVID, 0x0003, DDVID, 0x0002, ddb_octopus_le),
@@ -1696,7 +1695,7 @@ static struct pci_driver ddb_pci_driver = {
1696 .name = "DDBridge", 1695 .name = "DDBridge",
1697 .id_table = ddb_id_tbl, 1696 .id_table = ddb_id_tbl,
1698 .probe = ddb_probe, 1697 .probe = ddb_probe,
1699 .remove = __devexit_p(ddb_remove), 1698 .remove = ddb_remove,
1700}; 1699};
1701 1700
1702static __init int module_init_ddbridge(void) 1701static __init int module_init_ddbridge(void)
diff --git a/drivers/media/pci/dm1105/dm1105.c b/drivers/media/pci/dm1105/dm1105.c
index a609b3a9b146..904c3ea350f5 100644
--- a/drivers/media/pci/dm1105/dm1105.c
+++ b/drivers/media/pci/dm1105/dm1105.c
@@ -616,7 +616,7 @@ static void dm1105_set_dma_addr(struct dm1105_dev *dev)
616 dm_writel(DM1105_STADR, cpu_to_le32(dev->dma_addr)); 616 dm_writel(DM1105_STADR, cpu_to_le32(dev->dma_addr));
617} 617}
618 618
619static int __devinit dm1105_dma_map(struct dm1105_dev *dev) 619static int dm1105_dma_map(struct dm1105_dev *dev)
620{ 620{
621 dev->ts_buf = pci_alloc_consistent(dev->pdev, 621 dev->ts_buf = pci_alloc_consistent(dev->pdev,
622 6 * DM1105_DMA_BYTES, 622 6 * DM1105_DMA_BYTES,
@@ -736,7 +736,7 @@ static irqreturn_t dm1105_irq(int irq, void *dev_id)
736 return IRQ_HANDLED; 736 return IRQ_HANDLED;
737} 737}
738 738
739int __devinit dm1105_ir_init(struct dm1105_dev *dm1105) 739static int dm1105_ir_init(struct dm1105_dev *dm1105)
740{ 740{
741 struct rc_dev *dev; 741 struct rc_dev *dev;
742 int err = -ENOMEM; 742 int err = -ENOMEM;
@@ -776,12 +776,12 @@ int __devinit dm1105_ir_init(struct dm1105_dev *dm1105)
776 return 0; 776 return 0;
777} 777}
778 778
779void __devexit dm1105_ir_exit(struct dm1105_dev *dm1105) 779static void dm1105_ir_exit(struct dm1105_dev *dm1105)
780{ 780{
781 rc_unregister_device(dm1105->ir.dev); 781 rc_unregister_device(dm1105->ir.dev);
782} 782}
783 783
784static int __devinit dm1105_hw_init(struct dm1105_dev *dev) 784static int dm1105_hw_init(struct dm1105_dev *dev)
785{ 785{
786 dm1105_disable_irqs(dev); 786 dm1105_disable_irqs(dev);
787 787
@@ -849,7 +849,7 @@ static struct ds3000_config dvbworld_ds3000_config = {
849 .demod_address = 0x68, 849 .demod_address = 0x68,
850}; 850};
851 851
852static int __devinit frontend_init(struct dm1105_dev *dev) 852static int frontend_init(struct dm1105_dev *dev)
853{ 853{
854 int ret; 854 int ret;
855 855
@@ -949,7 +949,7 @@ static int __devinit frontend_init(struct dm1105_dev *dev)
949 return 0; 949 return 0;
950} 950}
951 951
952static void __devinit dm1105_read_mac(struct dm1105_dev *dev, u8 *mac) 952static void dm1105_read_mac(struct dm1105_dev *dev, u8 *mac)
953{ 953{
954 static u8 command[1] = { 0x28 }; 954 static u8 command[1] = { 0x28 };
955 955
@@ -971,7 +971,7 @@ static void __devinit dm1105_read_mac(struct dm1105_dev *dev, u8 *mac)
971 dev_info(&dev->pdev->dev, "MAC %pM\n", mac); 971 dev_info(&dev->pdev->dev, "MAC %pM\n", mac);
972} 972}
973 973
974static int __devinit dm1105_probe(struct pci_dev *pdev, 974static int dm1105_probe(struct pci_dev *pdev,
975 const struct pci_device_id *ent) 975 const struct pci_device_id *ent)
976{ 976{
977 struct dm1105_dev *dev; 977 struct dm1105_dev *dev;
@@ -1128,8 +1128,10 @@ static int __devinit dm1105_probe(struct pci_dev *pdev,
1128 INIT_WORK(&dev->work, dm1105_dmx_buffer); 1128 INIT_WORK(&dev->work, dm1105_dmx_buffer);
1129 sprintf(dev->wqn, "%s/%d", dvb_adapter->name, dvb_adapter->num); 1129 sprintf(dev->wqn, "%s/%d", dvb_adapter->name, dvb_adapter->num);
1130 dev->wq = create_singlethread_workqueue(dev->wqn); 1130 dev->wq = create_singlethread_workqueue(dev->wqn);
1131 if (!dev->wq) 1131 if (!dev->wq) {
1132 ret = -ENOMEM;
1132 goto err_dvb_net; 1133 goto err_dvb_net;
1134 }
1133 1135
1134 ret = request_irq(pdev->irq, dm1105_irq, IRQF_SHARED, 1136 ret = request_irq(pdev->irq, dm1105_irq, IRQF_SHARED,
1135 DRIVER_NAME, dev); 1137 DRIVER_NAME, dev);
@@ -1172,7 +1174,7 @@ err_kfree:
1172 return ret; 1174 return ret;
1173} 1175}
1174 1176
1175static void __devexit dm1105_remove(struct pci_dev *pdev) 1177static void dm1105_remove(struct pci_dev *pdev)
1176{ 1178{
1177 struct dm1105_dev *dev = pci_get_drvdata(pdev); 1179 struct dm1105_dev *dev = pci_get_drvdata(pdev);
1178 struct dvb_adapter *dvb_adapter = &dev->dvb_adapter; 1180 struct dvb_adapter *dvb_adapter = &dev->dvb_adapter;
@@ -1205,7 +1207,7 @@ static void __devexit dm1105_remove(struct pci_dev *pdev)
1205 kfree(dev); 1207 kfree(dev);
1206} 1208}
1207 1209
1208static struct pci_device_id dm1105_id_table[] __devinitdata = { 1210static struct pci_device_id dm1105_id_table[] = {
1209 { 1211 {
1210 .vendor = PCI_VENDOR_ID_TRIGEM, 1212 .vendor = PCI_VENDOR_ID_TRIGEM,
1211 .device = PCI_DEVICE_ID_DM1105, 1213 .device = PCI_DEVICE_ID_DM1105,
@@ -1227,7 +1229,7 @@ static struct pci_driver dm1105_driver = {
1227 .name = DRIVER_NAME, 1229 .name = DRIVER_NAME,
1228 .id_table = dm1105_id_table, 1230 .id_table = dm1105_id_table,
1229 .probe = dm1105_probe, 1231 .probe = dm1105_probe,
1230 .remove = __devexit_p(dm1105_remove), 1232 .remove = dm1105_remove,
1231}; 1233};
1232 1234
1233static int __init dm1105_init(void) 1235static int __init dm1105_init(void)
diff --git a/drivers/media/pci/ivtv/ivtv-alsa-main.c b/drivers/media/pci/ivtv/ivtv-alsa-main.c
index 8deab1629b3b..4a221c693995 100644
--- a/drivers/media/pci/ivtv/ivtv-alsa-main.c
+++ b/drivers/media/pci/ivtv/ivtv-alsa-main.c
@@ -205,7 +205,7 @@ err_exit:
205 return ret; 205 return ret;
206} 206}
207 207
208int ivtv_alsa_load(struct ivtv *itv) 208static int __init ivtv_alsa_load(struct ivtv *itv)
209{ 209{
210 struct v4l2_device *v4l2_dev = &itv->v4l2_dev; 210 struct v4l2_device *v4l2_dev = &itv->v4l2_dev;
211 struct ivtv_stream *s; 211 struct ivtv_stream *s;
diff --git a/drivers/media/pci/ivtv/ivtv-alsa-pcm.c b/drivers/media/pci/ivtv/ivtv-alsa-pcm.c
index f7022bd58ffd..e1863dbf4edc 100644
--- a/drivers/media/pci/ivtv/ivtv-alsa-pcm.c
+++ b/drivers/media/pci/ivtv/ivtv-alsa-pcm.c
@@ -37,6 +37,7 @@
37#include "ivtv-streams.h" 37#include "ivtv-streams.h"
38#include "ivtv-fileops.h" 38#include "ivtv-fileops.h"
39#include "ivtv-alsa.h" 39#include "ivtv-alsa.h"
40#include "ivtv-alsa-pcm.h"
40 41
41static unsigned int pcm_debug; 42static unsigned int pcm_debug;
42module_param(pcm_debug, int, 0644); 43module_param(pcm_debug, int, 0644);
@@ -69,8 +70,9 @@ static struct snd_pcm_hardware snd_ivtv_hw_capture = {
69 .periods_max = 98, /* 12544, */ 70 .periods_max = 98, /* 12544, */
70}; 71};
71 72
72void ivtv_alsa_announce_pcm_data(struct snd_ivtv_card *itvsc, u8 *pcm_data, 73static void ivtv_alsa_announce_pcm_data(struct snd_ivtv_card *itvsc,
73 size_t num_bytes) 74 u8 *pcm_data,
75 size_t num_bytes)
74{ 76{
75 struct snd_pcm_substream *substream; 77 struct snd_pcm_substream *substream;
76 struct snd_pcm_runtime *runtime; 78 struct snd_pcm_runtime *runtime;
diff --git a/drivers/media/pci/ivtv/ivtv-alsa-pcm.h b/drivers/media/pci/ivtv/ivtv-alsa-pcm.h
index 5ab18319ea4d..23dfe0d12400 100644
--- a/drivers/media/pci/ivtv/ivtv-alsa-pcm.h
+++ b/drivers/media/pci/ivtv/ivtv-alsa-pcm.h
@@ -21,7 +21,3 @@
21 */ 21 */
22 22
23int __init snd_ivtv_pcm_create(struct snd_ivtv_card *itvsc); 23int __init snd_ivtv_pcm_create(struct snd_ivtv_card *itvsc);
24
25/* Used by ivtv driver to announce the PCM data to the module */
26void ivtv_alsa_announce_pcm_data(struct snd_ivtv_card *card, u8 *pcm_data,
27 size_t num_bytes);
diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c
index 74e9a5032364..df88dc4ab555 100644
--- a/drivers/media/pci/ivtv/ivtv-driver.c
+++ b/drivers/media/pci/ivtv/ivtv-driver.c
@@ -73,7 +73,7 @@ int (*ivtv_ext_init)(struct ivtv *);
73EXPORT_SYMBOL(ivtv_ext_init); 73EXPORT_SYMBOL(ivtv_ext_init);
74 74
75/* add your revision and whatnot here */ 75/* add your revision and whatnot here */
76static struct pci_device_id ivtv_pci_tbl[] __devinitdata = { 76static struct pci_device_id ivtv_pci_tbl[] = {
77 {PCI_VENDOR_ID_ICOMP, PCI_DEVICE_ID_IVTV15, 77 {PCI_VENDOR_ID_ICOMP, PCI_DEVICE_ID_IVTV15,
78 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 78 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
79 {PCI_VENDOR_ID_ICOMP, PCI_DEVICE_ID_IVTV16, 79 {PCI_VENDOR_ID_ICOMP, PCI_DEVICE_ID_IVTV16,
@@ -736,7 +736,7 @@ done:
736 No assumptions on the card type may be made here (see ivtv_init_struct2 736 No assumptions on the card type may be made here (see ivtv_init_struct2
737 for that). 737 for that).
738 */ 738 */
739static int __devinit ivtv_init_struct1(struct ivtv *itv) 739static int ivtv_init_struct1(struct ivtv *itv)
740{ 740{
741 struct sched_param param = { .sched_priority = 99 }; 741 struct sched_param param = { .sched_priority = 99 };
742 742
@@ -802,7 +802,7 @@ static int __devinit ivtv_init_struct1(struct ivtv *itv)
802 802
803/* Second initialization part. Here the card type has been 803/* Second initialization part. Here the card type has been
804 autodetected. */ 804 autodetected. */
805static void __devinit ivtv_init_struct2(struct ivtv *itv) 805static void ivtv_init_struct2(struct ivtv *itv)
806{ 806{
807 int i; 807 int i;
808 808
@@ -1001,8 +1001,7 @@ static void ivtv_load_and_init_modules(struct ivtv *itv)
1001 } 1001 }
1002} 1002}
1003 1003
1004static int __devinit ivtv_probe(struct pci_dev *pdev, 1004static int ivtv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
1005 const struct pci_device_id *pci_id)
1006{ 1005{
1007 int retval = 0; 1006 int retval = 0;
1008 int vbi_buf_size; 1007 int vbi_buf_size;
diff --git a/drivers/media/pci/ivtv/ivtv-firmware.c b/drivers/media/pci/ivtv/ivtv-firmware.c
index 6ec7705af555..68387d4369d6 100644
--- a/drivers/media/pci/ivtv/ivtv-firmware.c
+++ b/drivers/media/pci/ivtv/ivtv-firmware.c
@@ -276,7 +276,7 @@ void ivtv_init_mpeg_decoder(struct ivtv *itv)
276} 276}
277 277
278/* Try to restart the card & restore previous settings */ 278/* Try to restart the card & restore previous settings */
279int ivtv_firmware_restart(struct ivtv *itv) 279static int ivtv_firmware_restart(struct ivtv *itv)
280{ 280{
281 int rc = 0; 281 int rc = 0;
282 v4l2_std_id std; 282 v4l2_std_id std;
diff --git a/drivers/media/pci/ivtv/ivtv-i2c.c b/drivers/media/pci/ivtv/ivtv-i2c.c
index d47f41a0ef66..46e262becb67 100644
--- a/drivers/media/pci/ivtv/ivtv-i2c.c
+++ b/drivers/media/pci/ivtv/ivtv-i2c.c
@@ -200,21 +200,21 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)
200 init_data->ir_codes = RC_MAP_AVERMEDIA_CARDBUS; 200 init_data->ir_codes = RC_MAP_AVERMEDIA_CARDBUS;
201 init_data->internal_get_key_func = 201 init_data->internal_get_key_func =
202 IR_KBD_GET_KEY_AVERMEDIA_CARDBUS; 202 IR_KBD_GET_KEY_AVERMEDIA_CARDBUS;
203 init_data->type = RC_TYPE_OTHER; 203 init_data->type = RC_BIT_OTHER;
204 init_data->name = "AVerMedia AVerTV card"; 204 init_data->name = "AVerMedia AVerTV card";
205 break; 205 break;
206 case IVTV_HW_I2C_IR_RX_HAUP_EXT: 206 case IVTV_HW_I2C_IR_RX_HAUP_EXT:
207 case IVTV_HW_I2C_IR_RX_HAUP_INT: 207 case IVTV_HW_I2C_IR_RX_HAUP_INT:
208 init_data->ir_codes = RC_MAP_HAUPPAUGE; 208 init_data->ir_codes = RC_MAP_HAUPPAUGE;
209 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP; 209 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP;
210 init_data->type = RC_TYPE_RC5; 210 init_data->type = RC_BIT_RC5;
211 init_data->name = itv->card_name; 211 init_data->name = itv->card_name;
212 break; 212 break;
213 case IVTV_HW_Z8F0811_IR_RX_HAUP: 213 case IVTV_HW_Z8F0811_IR_RX_HAUP:
214 /* Default to grey remote */ 214 /* Default to grey remote */
215 init_data->ir_codes = RC_MAP_HAUPPAUGE; 215 init_data->ir_codes = RC_MAP_HAUPPAUGE;
216 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; 216 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
217 init_data->type = RC_TYPE_RC5; 217 init_data->type = RC_BIT_RC5;
218 init_data->name = itv->card_name; 218 init_data->name = itv->card_name;
219 break; 219 break;
220 case IVTV_HW_I2C_IR_RX_ADAPTEC: 220 case IVTV_HW_I2C_IR_RX_ADAPTEC:
@@ -222,7 +222,7 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)
222 init_data->name = itv->card_name; 222 init_data->name = itv->card_name;
223 /* FIXME: The protocol and RC_MAP needs to be corrected */ 223 /* FIXME: The protocol and RC_MAP needs to be corrected */
224 init_data->ir_codes = RC_MAP_EMPTY; 224 init_data->ir_codes = RC_MAP_EMPTY;
225 init_data->type = RC_TYPE_UNKNOWN; 225 init_data->type = RC_BIT_UNKNOWN;
226 break; 226 break;
227 } 227 }
228 228
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c
index 949ae230e119..7a8b0d0b6127 100644
--- a/drivers/media/pci/ivtv/ivtv-ioctl.c
+++ b/drivers/media/pci/ivtv/ivtv-ioctl.c
@@ -993,7 +993,7 @@ int ivtv_s_input(struct file *file, void *fh, unsigned int inp)
993 v4l2_std_id std; 993 v4l2_std_id std;
994 int i; 994 int i;
995 995
996 if (inp < 0 || inp >= itv->nof_inputs) 996 if (inp >= itv->nof_inputs)
997 return -EINVAL; 997 return -EINVAL;
998 998
999 if (inp == itv->active_input) { 999 if (inp == itv->active_input) {
@@ -1168,7 +1168,7 @@ void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id *std)
1168 } 1168 }
1169} 1169}
1170 1170
1171int ivtv_s_std(struct file *file, void *fh, v4l2_std_id *std) 1171static int ivtv_s_std(struct file *file, void *fh, v4l2_std_id *std)
1172{ 1172{
1173 struct ivtv *itv = fh2id(fh)->itv; 1173 struct ivtv *itv = fh2id(fh)->itv;
1174 1174
diff --git a/drivers/media/pci/mantis/hopper_cards.c b/drivers/media/pci/mantis/hopper_cards.c
index cc0251e01077..6fe9fe5293dc 100644
--- a/drivers/media/pci/mantis/hopper_cards.c
+++ b/drivers/media/pci/mantis/hopper_cards.c
@@ -151,7 +151,8 @@ static irqreturn_t hopper_irq_handler(int irq, void *dev_id)
151 return IRQ_HANDLED; 151 return IRQ_HANDLED;
152} 152}
153 153
154static int __devinit hopper_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) 154static int hopper_pci_probe(struct pci_dev *pdev,
155 const struct pci_device_id *pci_id)
155{ 156{
156 struct mantis_pci *mantis; 157 struct mantis_pci *mantis;
157 struct mantis_hwconfig *config; 158 struct mantis_hwconfig *config;
@@ -230,7 +231,7 @@ fail0:
230 return err; 231 return err;
231} 232}
232 233
233static void __devexit hopper_pci_remove(struct pci_dev *pdev) 234static void hopper_pci_remove(struct pci_dev *pdev)
234{ 235{
235 struct mantis_pci *mantis = pci_get_drvdata(pdev); 236 struct mantis_pci *mantis = pci_get_drvdata(pdev);
236 237
@@ -259,12 +260,12 @@ static struct pci_driver hopper_pci_driver = {
259 .remove = hopper_pci_remove, 260 .remove = hopper_pci_remove,
260}; 261};
261 262
262static int __devinit hopper_init(void) 263static int hopper_init(void)
263{ 264{
264 return pci_register_driver(&hopper_pci_driver); 265 return pci_register_driver(&hopper_pci_driver);
265} 266}
266 267
267static void __devexit hopper_exit(void) 268static void hopper_exit(void)
268{ 269{
269 return pci_unregister_driver(&hopper_pci_driver); 270 return pci_unregister_driver(&hopper_pci_driver);
270} 271}
diff --git a/drivers/media/pci/mantis/mantis_cards.c b/drivers/media/pci/mantis/mantis_cards.c
index 0207d1f064e0..932a0d73a7f8 100644
--- a/drivers/media/pci/mantis/mantis_cards.c
+++ b/drivers/media/pci/mantis/mantis_cards.c
@@ -159,7 +159,8 @@ static irqreturn_t mantis_irq_handler(int irq, void *dev_id)
159 return IRQ_HANDLED; 159 return IRQ_HANDLED;
160} 160}
161 161
162static int __devinit mantis_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) 162static int mantis_pci_probe(struct pci_dev *pdev,
163 const struct pci_device_id *pci_id)
163{ 164{
164 struct mantis_pci *mantis; 165 struct mantis_pci *mantis;
165 struct mantis_hwconfig *config; 166 struct mantis_hwconfig *config;
@@ -249,7 +250,7 @@ fail0:
249 return err; 250 return err;
250} 251}
251 252
252static void __devexit mantis_pci_remove(struct pci_dev *pdev) 253static void mantis_pci_remove(struct pci_dev *pdev)
253{ 254{
254 struct mantis_pci *mantis = pci_get_drvdata(pdev); 255 struct mantis_pci *mantis = pci_get_drvdata(pdev);
255 256
@@ -289,12 +290,12 @@ static struct pci_driver mantis_pci_driver = {
289 .remove = mantis_pci_remove, 290 .remove = mantis_pci_remove,
290}; 291};
291 292
292static int __devinit mantis_init(void) 293static int mantis_init(void)
293{ 294{
294 return pci_register_driver(&mantis_pci_driver); 295 return pci_register_driver(&mantis_pci_driver);
295} 296}
296 297
297static void __devexit mantis_exit(void) 298static void mantis_exit(void)
298{ 299{
299 return pci_unregister_driver(&mantis_pci_driver); 300 return pci_unregister_driver(&mantis_pci_driver);
300} 301}
diff --git a/drivers/media/pci/mantis/mantis_dvb.c b/drivers/media/pci/mantis/mantis_dvb.c
index 5d15c6b74d9b..5a71e1791cf5 100644
--- a/drivers/media/pci/mantis/mantis_dvb.c
+++ b/drivers/media/pci/mantis/mantis_dvb.c
@@ -144,7 +144,7 @@ static int mantis_dvb_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
144 return 0; 144 return 0;
145} 145}
146 146
147int __devinit mantis_dvb_init(struct mantis_pci *mantis) 147int mantis_dvb_init(struct mantis_pci *mantis)
148{ 148{
149 struct mantis_hwconfig *config = mantis->hwconfig; 149 struct mantis_hwconfig *config = mantis->hwconfig;
150 int result = -1; 150 int result = -1;
@@ -271,7 +271,7 @@ err0:
271} 271}
272EXPORT_SYMBOL_GPL(mantis_dvb_init); 272EXPORT_SYMBOL_GPL(mantis_dvb_init);
273 273
274int __devexit mantis_dvb_exit(struct mantis_pci *mantis) 274int mantis_dvb_exit(struct mantis_pci *mantis)
275{ 275{
276 int err; 276 int err;
277 277
diff --git a/drivers/media/pci/mantis/mantis_i2c.c b/drivers/media/pci/mantis/mantis_i2c.c
index e7794517fe26..937fb9d50213 100644
--- a/drivers/media/pci/mantis/mantis_i2c.c
+++ b/drivers/media/pci/mantis/mantis_i2c.c
@@ -217,7 +217,7 @@ static struct i2c_algorithm mantis_algo = {
217 .functionality = mantis_i2c_func, 217 .functionality = mantis_i2c_func,
218}; 218};
219 219
220int __devinit mantis_i2c_init(struct mantis_pci *mantis) 220int mantis_i2c_init(struct mantis_pci *mantis)
221{ 221{
222 u32 intstat, intmask; 222 u32 intstat, intmask;
223 struct i2c_adapter *i2c_adapter = &mantis->adapter; 223 struct i2c_adapter *i2c_adapter = &mantis->adapter;
diff --git a/drivers/media/pci/mantis/mantis_input.c b/drivers/media/pci/mantis/mantis_input.c
index db6d54d3fec0..0e5252e5c0ef 100644
--- a/drivers/media/pci/mantis/mantis_input.c
+++ b/drivers/media/pci/mantis/mantis_input.c
@@ -18,6 +18,8 @@
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/ 19*/
20 20
21#if 0 /* Currently unused */
22
21#include <media/rc-core.h> 23#include <media/rc-core.h>
22#include <linux/pci.h> 24#include <linux/pci.h>
23 25
@@ -150,10 +152,11 @@ out:
150 return err; 152 return err;
151} 153}
152 154
153int mantis_exit(struct mantis_pci *mantis) 155int mantis_init_exit(struct mantis_pci *mantis)
154{ 156{
155 rc_unregister_device(mantis->rc); 157 rc_unregister_device(mantis->rc);
156 rc_map_unregister(&ir_mantis_map); 158 rc_map_unregister(&ir_mantis_map);
157 return 0; 159 return 0;
158} 160}
159 161
162#endif
diff --git a/drivers/media/pci/mantis/mantis_pci.c b/drivers/media/pci/mantis/mantis_pci.c
index 371558af2d96..a846036ea022 100644
--- a/drivers/media/pci/mantis/mantis_pci.c
+++ b/drivers/media/pci/mantis/mantis_pci.c
@@ -46,7 +46,7 @@
46 46
47#define DRIVER_NAME "Mantis Core" 47#define DRIVER_NAME "Mantis Core"
48 48
49int __devinit mantis_pci_init(struct mantis_pci *mantis) 49int mantis_pci_init(struct mantis_pci *mantis)
50{ 50{
51 u8 latency; 51 u8 latency;
52 struct mantis_hwconfig *config = mantis->hwconfig; 52 struct mantis_hwconfig *config = mantis->hwconfig;
diff --git a/drivers/media/pci/mantis/mantis_uart.c b/drivers/media/pci/mantis/mantis_uart.c
index 85e977861b4a..a70719218631 100644
--- a/drivers/media/pci/mantis/mantis_uart.c
+++ b/drivers/media/pci/mantis/mantis_uart.c
@@ -61,7 +61,7 @@ static struct {
61 61
62#define UART_MAX_BUF 16 62#define UART_MAX_BUF 16
63 63
64int mantis_uart_read(struct mantis_pci *mantis, u8 *data) 64static int mantis_uart_read(struct mantis_pci *mantis, u8 *data)
65{ 65{
66 struct mantis_hwconfig *config = mantis->hwconfig; 66 struct mantis_hwconfig *config = mantis->hwconfig;
67 u32 stat = 0, i; 67 u32 stat = 0, i;
diff --git a/drivers/media/pci/mantis/mantis_vp1033.c b/drivers/media/pci/mantis/mantis_vp1033.c
index ad013e93ed11..115003e8d19d 100644
--- a/drivers/media/pci/mantis/mantis_vp1033.c
+++ b/drivers/media/pci/mantis/mantis_vp1033.c
@@ -83,7 +83,7 @@ u8 lgtdqcs001f_inittab[] = {
83#define MANTIS_MODEL_NAME "VP-1033" 83#define MANTIS_MODEL_NAME "VP-1033"
84#define MANTIS_DEV_TYPE "DVB-S/DSS" 84#define MANTIS_DEV_TYPE "DVB-S/DSS"
85 85
86int lgtdqcs001f_tuner_set(struct dvb_frontend *fe) 86static int lgtdqcs001f_tuner_set(struct dvb_frontend *fe)
87{ 87{
88 struct dtv_frontend_properties *p = &fe->dtv_property_cache; 88 struct dtv_frontend_properties *p = &fe->dtv_property_cache;
89 struct mantis_pci *mantis = fe->dvb->priv; 89 struct mantis_pci *mantis = fe->dvb->priv;
@@ -115,8 +115,8 @@ int lgtdqcs001f_tuner_set(struct dvb_frontend *fe)
115 return 0; 115 return 0;
116} 116}
117 117
118int lgtdqcs001f_set_symbol_rate(struct dvb_frontend *fe, 118static int lgtdqcs001f_set_symbol_rate(struct dvb_frontend *fe,
119 u32 srate, u32 ratio) 119 u32 srate, u32 ratio)
120{ 120{
121 u8 aclk = 0; 121 u8 aclk = 0;
122 u8 bclk = 0; 122 u8 bclk = 0;
diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c
index e5a76da86081..049e18667cd0 100644
--- a/drivers/media/pci/meye/meye.c
+++ b/drivers/media/pci/meye/meye.c
@@ -1728,8 +1728,7 @@ static int meye_resume(struct pci_dev *pdev)
1728} 1728}
1729#endif 1729#endif
1730 1730
1731static int __devinit meye_probe(struct pci_dev *pcidev, 1731static int meye_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
1732 const struct pci_device_id *ent)
1733{ 1732{
1734 struct v4l2_device *v4l2_dev = &meye.v4l2_dev; 1733 struct v4l2_device *v4l2_dev = &meye.v4l2_dev;
1735 int ret = -EBUSY; 1734 int ret = -EBUSY;
@@ -1889,7 +1888,7 @@ outnotdev:
1889 return ret; 1888 return ret;
1890} 1889}
1891 1890
1892static void __devexit meye_remove(struct pci_dev *pcidev) 1891static void meye_remove(struct pci_dev *pcidev)
1893{ 1892{
1894 video_unregister_device(meye.vdev); 1893 video_unregister_device(meye.vdev);
1895 1894
@@ -1935,7 +1934,7 @@ static struct pci_driver meye_driver = {
1935 .name = "meye", 1934 .name = "meye",
1936 .id_table = meye_pci_tbl, 1935 .id_table = meye_pci_tbl,
1937 .probe = meye_probe, 1936 .probe = meye_probe,
1938 .remove = __devexit_p(meye_remove), 1937 .remove = meye_remove,
1939#ifdef CONFIG_PM 1938#ifdef CONFIG_PM
1940 .suspend = meye_suspend, 1939 .suspend = meye_suspend,
1941 .resume = meye_resume, 1940 .resume = meye_resume,
@@ -1945,7 +1944,7 @@ static struct pci_driver meye_driver = {
1945static int __init meye_init(void) 1944static int __init meye_init(void)
1946{ 1945{
1947 gbuffers = max(2, min((int)gbuffers, MEYE_MAX_BUFNBRS)); 1946 gbuffers = max(2, min((int)gbuffers, MEYE_MAX_BUFNBRS));
1948 if (gbufsize < 0 || gbufsize > MEYE_MAX_BUFSIZE) 1947 if (gbufsize > MEYE_MAX_BUFSIZE)
1949 gbufsize = MEYE_MAX_BUFSIZE; 1948 gbufsize = MEYE_MAX_BUFSIZE;
1950 gbufsize = PAGE_ALIGN(gbufsize); 1949 gbufsize = PAGE_ALIGN(gbufsize);
1951 printk(KERN_INFO "meye: using %d buffers with %dk (%dk total) " 1950 printk(KERN_INFO "meye: using %d buffers with %dk (%dk total) "
diff --git a/drivers/media/pci/ngene/ngene-cards.c b/drivers/media/pci/ngene/ngene-cards.c
index 96a13ed197d0..fad214113669 100644
--- a/drivers/media/pci/ngene/ngene-cards.c
+++ b/drivers/media/pci/ngene/ngene-cards.c
@@ -425,8 +425,10 @@ static int ReadEEProm(struct i2c_adapter *adapter,
425 status = i2c_read_eeprom(adapter, 0x50, Addr, data, Length); 425 status = i2c_read_eeprom(adapter, 0x50, Addr, data, Length);
426 if (!status) { 426 if (!status) {
427 *pLength = EETag[2]; 427 *pLength = EETag[2];
428#if 0
428 if (Length < EETag[2]) 429 if (Length < EETag[2])
429 ; /*status=STATUS_BUFFER_OVERFLOW; */ 430 status = STATUS_BUFFER_OVERFLOW;
431#endif
430 } 432 }
431 } 433 }
432 return status; 434 return status;
@@ -741,7 +743,7 @@ static struct ngene_info ngene_info_terratec = {
741 743
742/****************************************************************************/ 744/****************************************************************************/
743 745
744static const struct pci_device_id ngene_id_tbl[] __devinitdata = { 746static const struct pci_device_id ngene_id_tbl[] = {
745 NGENE_ID(0x18c3, 0xabc3, ngene_info_cineS2), 747 NGENE_ID(0x18c3, 0xabc3, ngene_info_cineS2),
746 NGENE_ID(0x18c3, 0xabc4, ngene_info_cineS2), 748 NGENE_ID(0x18c3, 0xabc4, ngene_info_cineS2),
747 NGENE_ID(0x18c3, 0xdb01, ngene_info_satixS2), 749 NGENE_ID(0x18c3, 0xdb01, ngene_info_satixS2),
@@ -798,7 +800,7 @@ static struct pci_driver ngene_pci_driver = {
798 .name = "ngene", 800 .name = "ngene",
799 .id_table = ngene_id_tbl, 801 .id_table = ngene_id_tbl,
800 .probe = ngene_probe, 802 .probe = ngene_probe,
801 .remove = __devexit_p(ngene_remove), 803 .remove = ngene_remove,
802 .err_handler = &ngene_errors, 804 .err_handler = &ngene_errors,
803 .shutdown = ngene_shutdown, 805 .shutdown = ngene_shutdown,
804}; 806};
diff --git a/drivers/media/pci/ngene/ngene-core.c b/drivers/media/pci/ngene/ngene-core.c
index c8e0d5b99d4c..37ebc42392ad 100644
--- a/drivers/media/pci/ngene/ngene-core.c
+++ b/drivers/media/pci/ngene/ngene-core.c
@@ -752,8 +752,8 @@ void set_transfer(struct ngene_channel *chan, int state)
752 if (chan->mode & NGENE_IO_TSIN) 752 if (chan->mode & NGENE_IO_TSIN)
753 chan->pBufferExchange = tsin_exchange; 753 chan->pBufferExchange = tsin_exchange;
754 spin_unlock_irq(&chan->state_lock); 754 spin_unlock_irq(&chan->state_lock);
755 } else 755 }
756 ;/* printk(KERN_INFO DEVICE_NAME ": lock=%08x\n", 756 /* else printk(KERN_INFO DEVICE_NAME ": lock=%08x\n",
757 ngreadl(0x9310)); */ 757 ngreadl(0x9310)); */
758 758
759 ret = ngene_command_stream_control(dev, chan->number, 759 ret = ngene_command_stream_control(dev, chan->number,
@@ -1636,7 +1636,7 @@ void ngene_shutdown(struct pci_dev *pdev)
1636/* device probe/remove calls ************************************************/ 1636/* device probe/remove calls ************************************************/
1637/****************************************************************************/ 1637/****************************************************************************/
1638 1638
1639void __devexit ngene_remove(struct pci_dev *pdev) 1639void ngene_remove(struct pci_dev *pdev)
1640{ 1640{
1641 struct ngene *dev = pci_get_drvdata(pdev); 1641 struct ngene *dev = pci_get_drvdata(pdev);
1642 int i; 1642 int i;
@@ -1652,8 +1652,7 @@ void __devexit ngene_remove(struct pci_dev *pdev)
1652 pci_disable_device(pdev); 1652 pci_disable_device(pdev);
1653} 1653}
1654 1654
1655int __devinit ngene_probe(struct pci_dev *pci_dev, 1655int ngene_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
1656 const struct pci_device_id *id)
1657{ 1656{
1658 struct ngene *dev; 1657 struct ngene *dev;
1659 int stat = 0; 1658 int stat = 0;
@@ -1691,7 +1690,8 @@ int __devinit ngene_probe(struct pci_dev *pci_dev,
1691 dev->i2c_current_bus = -1; 1690 dev->i2c_current_bus = -1;
1692 1691
1693 /* Register DVB adapters and devices for both channels */ 1692 /* Register DVB adapters and devices for both channels */
1694 if (init_channels(dev) < 0) 1693 stat = init_channels(dev);
1694 if (stat < 0)
1695 goto fail2; 1695 goto fail2;
1696 1696
1697 return 0; 1697 return 0;
diff --git a/drivers/media/pci/ngene/ngene.h b/drivers/media/pci/ngene/ngene.h
index 5443dc0caea5..22c39ff6bfa0 100644
--- a/drivers/media/pci/ngene/ngene.h
+++ b/drivers/media/pci/ngene/ngene.h
@@ -887,9 +887,8 @@ struct ngene_buffer {
887 887
888 888
889/* Provided by ngene-core.c */ 889/* Provided by ngene-core.c */
890int __devinit ngene_probe(struct pci_dev *pci_dev, 890int ngene_probe(struct pci_dev *pci_dev, const struct pci_device_id *id);
891 const struct pci_device_id *id); 891void ngene_remove(struct pci_dev *pdev);
892void __devexit ngene_remove(struct pci_dev *pdev);
893void ngene_shutdown(struct pci_dev *pdev); 892void ngene_shutdown(struct pci_dev *pdev);
894int ngene_command(struct ngene *dev, struct ngene_command *com); 893int ngene_command(struct ngene *dev, struct ngene_command *com);
895int ngene_command_gpio_set(struct ngene *dev, u8 select, u8 level); 894int ngene_command_gpio_set(struct ngene *dev, u8 select, u8 level);
diff --git a/drivers/media/pci/pluto2/pluto2.c b/drivers/media/pci/pluto2/pluto2.c
index f148b19a206a..2290faee5852 100644
--- a/drivers/media/pci/pluto2/pluto2.c
+++ b/drivers/media/pci/pluto2/pluto2.c
@@ -240,7 +240,7 @@ static void pluto_set_dma_addr(struct pluto *pluto)
240 pluto_writereg(pluto, REG_PCAR, pluto->dma_addr); 240 pluto_writereg(pluto, REG_PCAR, pluto->dma_addr);
241} 241}
242 242
243static int __devinit pluto_dma_map(struct pluto *pluto) 243static int pluto_dma_map(struct pluto *pluto)
244{ 244{
245 pluto->dma_addr = pci_map_single(pluto->pdev, pluto->dma_buf, 245 pluto->dma_addr = pci_map_single(pluto->pdev, pluto->dma_buf,
246 TS_DMA_BYTES, PCI_DMA_FROMDEVICE); 246 TS_DMA_BYTES, PCI_DMA_FROMDEVICE);
@@ -368,7 +368,7 @@ static irqreturn_t pluto_irq(int irq, void *dev_id)
368 return IRQ_HANDLED; 368 return IRQ_HANDLED;
369} 369}
370 370
371static void __devinit pluto_enable_irqs(struct pluto *pluto) 371static void pluto_enable_irqs(struct pluto *pluto)
372{ 372{
373 u32 val = pluto_readreg(pluto, REG_TSCR); 373 u32 val = pluto_readreg(pluto, REG_TSCR);
374 374
@@ -394,7 +394,7 @@ static void pluto_disable_irqs(struct pluto *pluto)
394 pluto_write_tscr(pluto, val); 394 pluto_write_tscr(pluto, val);
395} 395}
396 396
397static int __devinit pluto_hw_init(struct pluto *pluto) 397static int pluto_hw_init(struct pluto *pluto)
398{ 398{
399 pluto_reset_frontend(pluto, 1); 399 pluto_reset_frontend(pluto, 1);
400 400
@@ -505,7 +505,7 @@ static int pluto2_request_firmware(struct dvb_frontend *fe,
505 return request_firmware(fw, name, &pluto->pdev->dev); 505 return request_firmware(fw, name, &pluto->pdev->dev);
506} 506}
507 507
508static struct tda1004x_config pluto2_fe_config __devinitdata = { 508static struct tda1004x_config pluto2_fe_config = {
509 .demod_address = I2C_ADDR_TDA10046 >> 1, 509 .demod_address = I2C_ADDR_TDA10046 >> 1,
510 .invert = 1, 510 .invert = 1,
511 .invert_oclk = 0, 511 .invert_oclk = 0,
@@ -515,7 +515,7 @@ static struct tda1004x_config pluto2_fe_config __devinitdata = {
515 .request_firmware = pluto2_request_firmware, 515 .request_firmware = pluto2_request_firmware,
516}; 516};
517 517
518static int __devinit frontend_init(struct pluto *pluto) 518static int frontend_init(struct pluto *pluto)
519{ 519{
520 int ret; 520 int ret;
521 521
@@ -536,14 +536,14 @@ static int __devinit frontend_init(struct pluto *pluto)
536 return 0; 536 return 0;
537} 537}
538 538
539static void __devinit pluto_read_rev(struct pluto *pluto) 539static void pluto_read_rev(struct pluto *pluto)
540{ 540{
541 u32 val = pluto_readreg(pluto, REG_MISC) & MISC_DVR; 541 u32 val = pluto_readreg(pluto, REG_MISC) & MISC_DVR;
542 dev_info(&pluto->pdev->dev, "board revision %d.%d\n", 542 dev_info(&pluto->pdev->dev, "board revision %d.%d\n",
543 (val >> 12) & 0x0f, (val >> 4) & 0xff); 543 (val >> 12) & 0x0f, (val >> 4) & 0xff);
544} 544}
545 545
546static void __devinit pluto_read_mac(struct pluto *pluto, u8 *mac) 546static void pluto_read_mac(struct pluto *pluto, u8 *mac)
547{ 547{
548 u32 val = pluto_readreg(pluto, REG_MMAC); 548 u32 val = pluto_readreg(pluto, REG_MMAC);
549 mac[0] = (val >> 8) & 0xff; 549 mac[0] = (val >> 8) & 0xff;
@@ -560,7 +560,7 @@ static void __devinit pluto_read_mac(struct pluto *pluto, u8 *mac)
560 dev_info(&pluto->pdev->dev, "MAC %pM\n", mac); 560 dev_info(&pluto->pdev->dev, "MAC %pM\n", mac);
561} 561}
562 562
563static int __devinit pluto_read_serial(struct pluto *pluto) 563static int pluto_read_serial(struct pluto *pluto)
564{ 564{
565 struct pci_dev *pdev = pluto->pdev; 565 struct pci_dev *pdev = pluto->pdev;
566 unsigned int i, j; 566 unsigned int i, j;
@@ -588,8 +588,7 @@ out:
588 return 0; 588 return 0;
589} 589}
590 590
591static int __devinit pluto2_probe(struct pci_dev *pdev, 591static int pluto2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
592 const struct pci_device_id *ent)
593{ 592{
594 struct pluto *pluto; 593 struct pluto *pluto;
595 struct dvb_adapter *dvb_adapter; 594 struct dvb_adapter *dvb_adapter;
@@ -742,7 +741,7 @@ err_kfree:
742 goto out; 741 goto out;
743} 742}
744 743
745static void __devexit pluto2_remove(struct pci_dev *pdev) 744static void pluto2_remove(struct pci_dev *pdev)
746{ 745{
747 struct pluto *pluto = pci_get_drvdata(pdev); 746 struct pluto *pluto = pci_get_drvdata(pdev);
748 struct dvb_adapter *dvb_adapter = &pluto->dvb_adapter; 747 struct dvb_adapter *dvb_adapter = &pluto->dvb_adapter;
@@ -777,7 +776,7 @@ static void __devexit pluto2_remove(struct pci_dev *pdev)
777#define PCI_DEVICE_ID_PLUTO2 0x0001 776#define PCI_DEVICE_ID_PLUTO2 0x0001
778#endif 777#endif
779 778
780static struct pci_device_id pluto2_id_table[] __devinitdata = { 779static struct pci_device_id pluto2_id_table[] = {
781 { 780 {
782 .vendor = PCI_VENDOR_ID_SCM, 781 .vendor = PCI_VENDOR_ID_SCM,
783 .device = PCI_DEVICE_ID_PLUTO2, 782 .device = PCI_DEVICE_ID_PLUTO2,
@@ -794,7 +793,7 @@ static struct pci_driver pluto2_driver = {
794 .name = DRIVER_NAME, 793 .name = DRIVER_NAME,
795 .id_table = pluto2_id_table, 794 .id_table = pluto2_id_table,
796 .probe = pluto2_probe, 795 .probe = pluto2_probe,
797 .remove = __devexit_p(pluto2_remove), 796 .remove = pluto2_remove,
798}; 797};
799 798
800static int __init pluto2_init(void) 799static int __init pluto2_init(void)
diff --git a/drivers/media/pci/pt1/pt1.c b/drivers/media/pci/pt1/pt1.c
index 15b35c4725f1..e9211086df49 100644
--- a/drivers/media/pci/pt1/pt1.c
+++ b/drivers/media/pci/pt1/pt1.c
@@ -1058,7 +1058,7 @@ static void pt1_i2c_init(struct pt1 *pt1)
1058 pt1_i2c_emit(pt1, i, 0, 0, 1, 1, 0); 1058 pt1_i2c_emit(pt1, i, 0, 0, 1, 1, 0);
1059} 1059}
1060 1060
1061static void __devexit pt1_remove(struct pci_dev *pdev) 1061static void pt1_remove(struct pci_dev *pdev)
1062{ 1062{
1063 struct pt1 *pt1; 1063 struct pt1 *pt1;
1064 void __iomem *regs; 1064 void __iomem *regs;
@@ -1083,8 +1083,7 @@ static void __devexit pt1_remove(struct pci_dev *pdev)
1083 pci_disable_device(pdev); 1083 pci_disable_device(pdev);
1084} 1084}
1085 1085
1086static int __devinit 1086static int pt1_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1087pt1_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1088{ 1087{
1089 int ret; 1088 int ret;
1090 void __iomem *regs; 1089 void __iomem *regs;
@@ -1222,7 +1221,7 @@ MODULE_DEVICE_TABLE(pci, pt1_id_table);
1222static struct pci_driver pt1_driver = { 1221static struct pci_driver pt1_driver = {
1223 .name = DRIVER_NAME, 1222 .name = DRIVER_NAME,
1224 .probe = pt1_probe, 1223 .probe = pt1_probe,
1225 .remove = __devexit_p(pt1_remove), 1224 .remove = pt1_remove,
1226 .id_table = pt1_id_table, 1225 .id_table = pt1_id_table,
1227}; 1226};
1228 1227
diff --git a/drivers/media/pci/saa7134/saa7134-core.c b/drivers/media/pci/saa7134/saa7134-core.c
index f2b37e05b964..e359d200d698 100644
--- a/drivers/media/pci/saa7134/saa7134-core.c
+++ b/drivers/media/pci/saa7134/saa7134-core.c
@@ -754,7 +754,7 @@ static int saa7134_hwfini(struct saa7134_dev *dev)
754 return 0; 754 return 0;
755} 755}
756 756
757static void __devinit must_configure_manually(int has_eeprom) 757static void must_configure_manually(int has_eeprom)
758{ 758{
759 unsigned int i,p; 759 unsigned int i,p;
760 760
@@ -860,8 +860,8 @@ static void mpeg_ops_detach(struct saa7134_mpeg_ops *ops,
860 dev->mops = NULL; 860 dev->mops = NULL;
861} 861}
862 862
863static int __devinit saa7134_initdev(struct pci_dev *pci_dev, 863static int saa7134_initdev(struct pci_dev *pci_dev,
864 const struct pci_device_id *pci_id) 864 const struct pci_device_id *pci_id)
865{ 865{
866 struct saa7134_dev *dev; 866 struct saa7134_dev *dev;
867 struct saa7134_mpeg_ops *mops; 867 struct saa7134_mpeg_ops *mops;
@@ -944,8 +944,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
944 944
945 /* board config */ 945 /* board config */
946 dev->board = pci_id->driver_data; 946 dev->board = pci_id->driver_data;
947 if (card[dev->nr] >= 0 && 947 if ((unsigned)card[dev->nr] < saa7134_bcount)
948 card[dev->nr] < saa7134_bcount)
949 dev->board = card[dev->nr]; 948 dev->board = card[dev->nr];
950 if (SAA7134_BOARD_UNKNOWN == dev->board) 949 if (SAA7134_BOARD_UNKNOWN == dev->board)
951 must_configure_manually(0); 950 must_configure_manually(0);
@@ -1103,7 +1102,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
1103 return err; 1102 return err;
1104} 1103}
1105 1104
1106static void __devexit saa7134_finidev(struct pci_dev *pci_dev) 1105static void saa7134_finidev(struct pci_dev *pci_dev)
1107{ 1106{
1108 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev); 1107 struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev);
1109 struct saa7134_dev *dev = container_of(v4l2_dev, struct saa7134_dev, v4l2_dev); 1108 struct saa7134_dev *dev = container_of(v4l2_dev, struct saa7134_dev, v4l2_dev);
@@ -1323,7 +1322,7 @@ static struct pci_driver saa7134_pci_driver = {
1323 .name = "saa7134", 1322 .name = "saa7134",
1324 .id_table = saa7134_pci_tbl, 1323 .id_table = saa7134_pci_tbl,
1325 .probe = saa7134_initdev, 1324 .probe = saa7134_initdev,
1326 .remove = __devexit_p(saa7134_finidev), 1325 .remove = saa7134_finidev,
1327#ifdef CONFIG_PM 1326#ifdef CONFIG_PM
1328 .suspend = saa7134_suspend, 1327 .suspend = saa7134_suspend,
1329 .resume = saa7134_resume 1328 .resume = saa7134_resume
diff --git a/drivers/media/pci/saa7134/saa7134-input.c b/drivers/media/pci/saa7134/saa7134-input.c
index 0f78f5e537e2..e761262f7475 100644
--- a/drivers/media/pci/saa7134/saa7134-input.c
+++ b/drivers/media/pci/saa7134/saa7134-input.c
@@ -990,7 +990,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
990 dev->init_data.name = "BeholdTV"; 990 dev->init_data.name = "BeholdTV";
991 dev->init_data.get_key = get_key_beholdm6xx; 991 dev->init_data.get_key = get_key_beholdm6xx;
992 dev->init_data.ir_codes = RC_MAP_BEHOLD; 992 dev->init_data.ir_codes = RC_MAP_BEHOLD;
993 dev->init_data.type = RC_TYPE_NEC; 993 dev->init_data.type = RC_BIT_NEC;
994 info.addr = 0x2d; 994 info.addr = 0x2d;
995 break; 995 break;
996 case SAA7134_BOARD_AVERMEDIA_CARDBUS_501: 996 case SAA7134_BOARD_AVERMEDIA_CARDBUS_501:
diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c
index 4a77124ee70e..3abf52711e13 100644
--- a/drivers/media/pci/saa7134/saa7134-video.c
+++ b/drivers/media/pci/saa7134/saa7134-video.c
@@ -2511,7 +2511,7 @@ int saa7134_video_init1(struct saa7134_dev *dev)
2511 /* sanitycheck insmod options */ 2511 /* sanitycheck insmod options */
2512 if (gbuffers < 2 || gbuffers > VIDEO_MAX_FRAME) 2512 if (gbuffers < 2 || gbuffers > VIDEO_MAX_FRAME)
2513 gbuffers = 2; 2513 gbuffers = 2;
2514 if (gbufsize < 0 || gbufsize > gbufsize_max) 2514 if (gbufsize > gbufsize_max)
2515 gbufsize = gbufsize_max; 2515 gbufsize = gbufsize_max;
2516 gbufsize = (gbufsize + PAGE_SIZE - 1) & PAGE_MASK; 2516 gbufsize = (gbufsize + PAGE_SIZE - 1) & PAGE_MASK;
2517 2517
diff --git a/drivers/media/pci/saa7134/saa7134.h b/drivers/media/pci/saa7134/saa7134.h
index c24b6512bd8f..075908fae4d9 100644
--- a/drivers/media/pci/saa7134/saa7134.h
+++ b/drivers/media/pci/saa7134/saa7134.h
@@ -739,7 +739,7 @@ extern int (*saa7134_dmasound_exit)(struct saa7134_dev *dev);
739 739
740extern struct saa7134_board saa7134_boards[]; 740extern struct saa7134_board saa7134_boards[];
741extern const unsigned int saa7134_bcount; 741extern const unsigned int saa7134_bcount;
742extern struct pci_device_id __devinitdata saa7134_pci_tbl[]; 742extern struct pci_device_id saa7134_pci_tbl[];
743 743
744extern int saa7134_board_init1(struct saa7134_dev *dev); 744extern int saa7134_board_init1(struct saa7134_dev *dev);
745extern int saa7134_board_init2(struct saa7134_dev *dev); 745extern int saa7134_board_init2(struct saa7134_dev *dev);
diff --git a/drivers/media/pci/saa7164/saa7164-api.c b/drivers/media/pci/saa7164/saa7164-api.c
index eff7135cf0e8..e042963d377d 100644
--- a/drivers/media/pci/saa7164/saa7164-api.c
+++ b/drivers/media/pci/saa7164/saa7164-api.c
@@ -165,7 +165,7 @@ int saa7164_api_set_vbi_format(struct saa7164_port *port)
165 return ret; 165 return ret;
166} 166}
167 167
168int saa7164_api_set_gop_size(struct saa7164_port *port) 168static int saa7164_api_set_gop_size(struct saa7164_port *port)
169{ 169{
170 struct saa7164_dev *dev = port->dev; 170 struct saa7164_dev *dev = port->dev;
171 struct tmComResEncVideoGopStructure gs; 171 struct tmComResEncVideoGopStructure gs;
@@ -619,7 +619,7 @@ int saa7164_api_get_videomux(struct saa7164_port *port)
619 return ret; 619 return ret;
620} 620}
621 621
622int saa7164_api_set_dif(struct saa7164_port *port, u8 reg, u8 val) 622static int saa7164_api_set_dif(struct saa7164_port *port, u8 reg, u8 val)
623{ 623{
624 struct saa7164_dev *dev = port->dev; 624 struct saa7164_dev *dev = port->dev;
625 625
@@ -822,8 +822,8 @@ int saa7164_api_read_eeprom(struct saa7164_dev *dev, u8 *buf, int buflen)
822 &reg[0], 128, buf); 822 &reg[0], 128, buf);
823} 823}
824 824
825int saa7164_api_configure_port_vbi(struct saa7164_dev *dev, 825static int saa7164_api_configure_port_vbi(struct saa7164_dev *dev,
826 struct saa7164_port *port) 826 struct saa7164_port *port)
827{ 827{
828 struct tmComResVBIFormatDescrHeader *fmt = &port->vbi_fmt_ntsc; 828 struct tmComResVBIFormatDescrHeader *fmt = &port->vbi_fmt_ntsc;
829 829
@@ -858,9 +858,10 @@ int saa7164_api_configure_port_vbi(struct saa7164_dev *dev,
858 return 0; 858 return 0;
859} 859}
860 860
861int saa7164_api_configure_port_mpeg2ts(struct saa7164_dev *dev, 861static int
862 struct saa7164_port *port, 862saa7164_api_configure_port_mpeg2ts(struct saa7164_dev *dev,
863 struct tmComResTSFormatDescrHeader *tsfmt) 863 struct saa7164_port *port,
864 struct tmComResTSFormatDescrHeader *tsfmt)
864{ 865{
865 dprintk(DBGLVL_API, " bFormatIndex = 0x%x\n", tsfmt->bFormatIndex); 866 dprintk(DBGLVL_API, " bFormatIndex = 0x%x\n", tsfmt->bFormatIndex);
866 dprintk(DBGLVL_API, " bDataOffset = 0x%x\n", tsfmt->bDataOffset); 867 dprintk(DBGLVL_API, " bDataOffset = 0x%x\n", tsfmt->bDataOffset);
@@ -892,9 +893,10 @@ int saa7164_api_configure_port_mpeg2ts(struct saa7164_dev *dev,
892 return 0; 893 return 0;
893} 894}
894 895
895int saa7164_api_configure_port_mpeg2ps(struct saa7164_dev *dev, 896static int
896 struct saa7164_port *port, 897saa7164_api_configure_port_mpeg2ps(struct saa7164_dev *dev,
897 struct tmComResPSFormatDescrHeader *fmt) 898 struct saa7164_port *port,
899 struct tmComResPSFormatDescrHeader *fmt)
898{ 900{
899 dprintk(DBGLVL_API, " bFormatIndex = 0x%x\n", fmt->bFormatIndex); 901 dprintk(DBGLVL_API, " bFormatIndex = 0x%x\n", fmt->bFormatIndex);
900 dprintk(DBGLVL_API, " wPacketLength= 0x%x\n", fmt->wPacketLength); 902 dprintk(DBGLVL_API, " wPacketLength= 0x%x\n", fmt->wPacketLength);
@@ -925,7 +927,7 @@ int saa7164_api_configure_port_mpeg2ps(struct saa7164_dev *dev,
925 return 0; 927 return 0;
926} 928}
927 929
928int saa7164_api_dump_subdevs(struct saa7164_dev *dev, u8 *buf, int len) 930static int saa7164_api_dump_subdevs(struct saa7164_dev *dev, u8 *buf, int len)
929{ 931{
930 struct saa7164_port *tsport = NULL; 932 struct saa7164_port *tsport = NULL;
931 struct saa7164_port *encport = NULL; 933 struct saa7164_port *encport = NULL;
@@ -1486,7 +1488,7 @@ int saa7164_api_i2c_write(struct saa7164_i2c *bus, u8 addr, u32 datalen,
1486 return ret == SAA_OK ? 0 : -EIO; 1488 return ret == SAA_OK ? 0 : -EIO;
1487} 1489}
1488 1490
1489int saa7164_api_modify_gpio(struct saa7164_dev *dev, u8 unitid, 1491static int saa7164_api_modify_gpio(struct saa7164_dev *dev, u8 unitid,
1490 u8 pin, u8 state) 1492 u8 pin, u8 state)
1491{ 1493{
1492 int ret; 1494 int ret;
diff --git a/drivers/media/pci/saa7164/saa7164-bus.c b/drivers/media/pci/saa7164/saa7164-bus.c
index a7f58a998752..5f6f3094c44e 100644
--- a/drivers/media/pci/saa7164/saa7164-bus.c
+++ b/drivers/media/pci/saa7164/saa7164-bus.c
@@ -81,7 +81,7 @@ void saa7164_bus_dump(struct saa7164_dev *dev)
81} 81}
82 82
83/* Intensionally throw a BUG() if the state of the message bus looks corrupt */ 83/* Intensionally throw a BUG() if the state of the message bus looks corrupt */
84void saa7164_bus_verify(struct saa7164_dev *dev) 84static void saa7164_bus_verify(struct saa7164_dev *dev)
85{ 85{
86 struct tmComResBusInfo *b = &dev->bus; 86 struct tmComResBusInfo *b = &dev->bus;
87 int bug = 0; 87 int bug = 0;
@@ -106,8 +106,8 @@ void saa7164_bus_verify(struct saa7164_dev *dev)
106 } 106 }
107} 107}
108 108
109void saa7164_bus_dumpmsg(struct saa7164_dev *dev, struct tmComResInfo* m, 109static void saa7164_bus_dumpmsg(struct saa7164_dev *dev, struct tmComResInfo *m,
110 void *buf) 110 void *buf)
111{ 111{
112 dprintk(DBGLVL_BUS, "Dumping msg structure:\n"); 112 dprintk(DBGLVL_BUS, "Dumping msg structure:\n");
113 dprintk(DBGLVL_BUS, " .id = %d\n", m->id); 113 dprintk(DBGLVL_BUS, " .id = %d\n", m->id);
diff --git a/drivers/media/pci/saa7164/saa7164-cmd.c b/drivers/media/pci/saa7164/saa7164-cmd.c
index 62fac7f9d04e..cfabcbacc33d 100644
--- a/drivers/media/pci/saa7164/saa7164-cmd.c
+++ b/drivers/media/pci/saa7164/saa7164-cmd.c
@@ -23,7 +23,7 @@
23 23
24#include "saa7164.h" 24#include "saa7164.h"
25 25
26int saa7164_cmd_alloc_seqno(struct saa7164_dev *dev) 26static int saa7164_cmd_alloc_seqno(struct saa7164_dev *dev)
27{ 27{
28 int i, ret = -1; 28 int i, ret = -1;
29 29
@@ -42,7 +42,7 @@ int saa7164_cmd_alloc_seqno(struct saa7164_dev *dev)
42 return ret; 42 return ret;
43} 43}
44 44
45void saa7164_cmd_free_seqno(struct saa7164_dev *dev, u8 seqno) 45static void saa7164_cmd_free_seqno(struct saa7164_dev *dev, u8 seqno)
46{ 46{
47 mutex_lock(&dev->lock); 47 mutex_lock(&dev->lock);
48 if ((dev->cmds[seqno].inuse == 1) && 48 if ((dev->cmds[seqno].inuse == 1) &&
@@ -54,7 +54,7 @@ void saa7164_cmd_free_seqno(struct saa7164_dev *dev, u8 seqno)
54 mutex_unlock(&dev->lock); 54 mutex_unlock(&dev->lock);
55} 55}
56 56
57void saa7164_cmd_timeout_seqno(struct saa7164_dev *dev, u8 seqno) 57static void saa7164_cmd_timeout_seqno(struct saa7164_dev *dev, u8 seqno)
58{ 58{
59 mutex_lock(&dev->lock); 59 mutex_lock(&dev->lock);
60 if ((dev->cmds[seqno].inuse == 1) && 60 if ((dev->cmds[seqno].inuse == 1) &&
@@ -64,7 +64,7 @@ void saa7164_cmd_timeout_seqno(struct saa7164_dev *dev, u8 seqno)
64 mutex_unlock(&dev->lock); 64 mutex_unlock(&dev->lock);
65} 65}
66 66
67u32 saa7164_cmd_timeout_get(struct saa7164_dev *dev, u8 seqno) 67static u32 saa7164_cmd_timeout_get(struct saa7164_dev *dev, u8 seqno)
68{ 68{
69 int ret = 0; 69 int ret = 0;
70 70
@@ -132,7 +132,7 @@ int saa7164_irq_dequeue(struct saa7164_dev *dev)
132 132
133/* Commands to the f/w get marshelled to/from this code then onto the PCI 133/* Commands to the f/w get marshelled to/from this code then onto the PCI
134 * -bus/c running buffer. */ 134 * -bus/c running buffer. */
135int saa7164_cmd_dequeue(struct saa7164_dev *dev) 135static int saa7164_cmd_dequeue(struct saa7164_dev *dev)
136{ 136{
137 int loop = 1; 137 int loop = 1;
138 int ret; 138 int ret;
@@ -186,8 +186,8 @@ int saa7164_cmd_dequeue(struct saa7164_dev *dev)
186 return SAA_OK; 186 return SAA_OK;
187} 187}
188 188
189int saa7164_cmd_set(struct saa7164_dev *dev, struct tmComResInfo *msg, 189static int saa7164_cmd_set(struct saa7164_dev *dev, struct tmComResInfo *msg,
190 void *buf) 190 void *buf)
191{ 191{
192 struct tmComResBusInfo *bus = &dev->bus; 192 struct tmComResBusInfo *bus = &dev->bus;
193 u8 cmd_sent; 193 u8 cmd_sent;
@@ -259,7 +259,7 @@ out:
259/* Wait for a signal event, without holding a mutex. Either return TIMEOUT if 259/* Wait for a signal event, without holding a mutex. Either return TIMEOUT if
260 * the event never occurred, or SAA_OK if it was signaled during the wait. 260 * the event never occurred, or SAA_OK if it was signaled during the wait.
261 */ 261 */
262int saa7164_cmd_wait(struct saa7164_dev *dev, u8 seqno) 262static int saa7164_cmd_wait(struct saa7164_dev *dev, u8 seqno)
263{ 263{
264 wait_queue_head_t *q = NULL; 264 wait_queue_head_t *q = NULL;
265 int ret = SAA_BUS_TIMEOUT; 265 int ret = SAA_BUS_TIMEOUT;
diff --git a/drivers/media/pci/saa7164/saa7164-core.c b/drivers/media/pci/saa7164/saa7164-core.c
index 2c9ad878bef3..63502e7a2a76 100644
--- a/drivers/media/pci/saa7164/saa7164-core.c
+++ b/drivers/media/pci/saa7164/saa7164-core.c
@@ -410,7 +410,7 @@ static void saa7164_work_enchandler(struct work_struct *w)
410 } else 410 } else
411 rp = (port->last_svc_rp + 1) % 8; 411 rp = (port->last_svc_rp + 1) % 8;
412 412
413 if ((rp < 0) || (rp > (port->hwcfg.buffercount - 1))) { 413 if (rp > (port->hwcfg.buffercount - 1)) {
414 printk(KERN_ERR "%s() illegal rp count %d\n", __func__, rp); 414 printk(KERN_ERR "%s() illegal rp count %d\n", __func__, rp);
415 break; 415 break;
416 } 416 }
@@ -486,7 +486,7 @@ static void saa7164_work_vbihandler(struct work_struct *w)
486 } else 486 } else
487 rp = (port->last_svc_rp + 1) % 8; 487 rp = (port->last_svc_rp + 1) % 8;
488 488
489 if ((rp < 0) || (rp > (port->hwcfg.buffercount - 1))) { 489 if (rp > (port->hwcfg.buffercount - 1)) {
490 printk(KERN_ERR "%s() illegal rp count %d\n", __func__, rp); 490 printk(KERN_ERR "%s() illegal rp count %d\n", __func__, rp);
491 break; 491 break;
492 } 492 }
@@ -1185,8 +1185,8 @@ static int saa7164_thread_function(void *data)
1185 return 0; 1185 return 0;
1186} 1186}
1187 1187
1188static int __devinit saa7164_initdev(struct pci_dev *pci_dev, 1188static int saa7164_initdev(struct pci_dev *pci_dev,
1189 const struct pci_device_id *pci_id) 1189 const struct pci_device_id *pci_id)
1190{ 1190{
1191 struct saa7164_dev *dev; 1191 struct saa7164_dev *dev;
1192 int err, i; 1192 int err, i;
@@ -1376,7 +1376,7 @@ static void saa7164_shutdown(struct saa7164_dev *dev)
1376 dprintk(1, "%s()\n", __func__); 1376 dprintk(1, "%s()\n", __func__);
1377} 1377}
1378 1378
1379static void __devexit saa7164_finidev(struct pci_dev *pci_dev) 1379static void saa7164_finidev(struct pci_dev *pci_dev)
1380{ 1380{
1381 struct saa7164_dev *dev = pci_get_drvdata(pci_dev); 1381 struct saa7164_dev *dev = pci_get_drvdata(pci_dev);
1382 1382
@@ -1459,7 +1459,7 @@ static struct pci_driver saa7164_pci_driver = {
1459 .name = "saa7164", 1459 .name = "saa7164",
1460 .id_table = saa7164_pci_tbl, 1460 .id_table = saa7164_pci_tbl,
1461 .probe = saa7164_initdev, 1461 .probe = saa7164_initdev,
1462 .remove = __devexit_p(saa7164_finidev), 1462 .remove = saa7164_finidev,
1463 /* TODO */ 1463 /* TODO */
1464 .suspend = NULL, 1464 .suspend = NULL,
1465 .resume = NULL, 1465 .resume = NULL,
diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c
index a9ed686ad08a..994018e2d0d6 100644
--- a/drivers/media/pci/saa7164/saa7164-encoder.c
+++ b/drivers/media/pci/saa7164/saa7164-encoder.c
@@ -1101,7 +1101,8 @@ static int fops_release(struct file *file)
1101 return 0; 1101 return 0;
1102} 1102}
1103 1103
1104struct saa7164_user_buffer *saa7164_enc_next_buf(struct saa7164_port *port) 1104static struct
1105saa7164_user_buffer *saa7164_enc_next_buf(struct saa7164_port *port)
1105{ 1106{
1106 struct saa7164_user_buffer *ubuf = NULL; 1107 struct saa7164_user_buffer *ubuf = NULL;
1107 struct saa7164_dev *dev = port->dev; 1108 struct saa7164_dev *dev = port->dev;
@@ -1287,8 +1288,8 @@ static const struct v4l2_file_operations mpeg_fops = {
1287 .unlocked_ioctl = video_ioctl2, 1288 .unlocked_ioctl = video_ioctl2,
1288}; 1289};
1289 1290
1290int saa7164_g_chip_ident(struct file *file, void *fh, 1291static int saa7164_g_chip_ident(struct file *file, void *fh,
1291 struct v4l2_dbg_chip_ident *chip) 1292 struct v4l2_dbg_chip_ident *chip)
1292{ 1293{
1293 struct saa7164_port *port = ((struct saa7164_encoder_fh *)fh)->port; 1294 struct saa7164_port *port = ((struct saa7164_encoder_fh *)fh)->port;
1294 struct saa7164_dev *dev = port->dev; 1295 struct saa7164_dev *dev = port->dev;
@@ -1297,8 +1298,8 @@ int saa7164_g_chip_ident(struct file *file, void *fh,
1297 return 0; 1298 return 0;
1298} 1299}
1299 1300
1300int saa7164_g_register(struct file *file, void *fh, 1301static int saa7164_g_register(struct file *file, void *fh,
1301 struct v4l2_dbg_register *reg) 1302 struct v4l2_dbg_register *reg)
1302{ 1303{
1303 struct saa7164_port *port = ((struct saa7164_encoder_fh *)fh)->port; 1304 struct saa7164_port *port = ((struct saa7164_encoder_fh *)fh)->port;
1304 struct saa7164_dev *dev = port->dev; 1305 struct saa7164_dev *dev = port->dev;
@@ -1310,8 +1311,8 @@ int saa7164_g_register(struct file *file, void *fh,
1310 return 0; 1311 return 0;
1311} 1312}
1312 1313
1313int saa7164_s_register(struct file *file, void *fh, 1314static int saa7164_s_register(struct file *file, void *fh,
1314 struct v4l2_dbg_register *reg) 1315 struct v4l2_dbg_register *reg)
1315{ 1316{
1316 struct saa7164_port *port = ((struct saa7164_encoder_fh *)fh)->port; 1317 struct saa7164_port *port = ((struct saa7164_encoder_fh *)fh)->port;
1317 struct saa7164_dev *dev = port->dev; 1318 struct saa7164_dev *dev = port->dev;
diff --git a/drivers/media/pci/saa7164/saa7164-fw.c b/drivers/media/pci/saa7164/saa7164-fw.c
index a266bf0169e6..86763203d61d 100644
--- a/drivers/media/pci/saa7164/saa7164-fw.c
+++ b/drivers/media/pci/saa7164/saa7164-fw.c
@@ -37,7 +37,7 @@ struct fw_header {
37 u32 version; 37 u32 version;
38}; 38};
39 39
40int saa7164_dl_wait_ack(struct saa7164_dev *dev, u32 reg) 40static int saa7164_dl_wait_ack(struct saa7164_dev *dev, u32 reg)
41{ 41{
42 u32 timeout = SAA_DEVICE_TIMEOUT; 42 u32 timeout = SAA_DEVICE_TIMEOUT;
43 while ((saa7164_readl(reg) & 0x01) == 0) { 43 while ((saa7164_readl(reg) & 0x01) == 0) {
@@ -53,7 +53,7 @@ int saa7164_dl_wait_ack(struct saa7164_dev *dev, u32 reg)
53 return 0; 53 return 0;
54} 54}
55 55
56int saa7164_dl_wait_clr(struct saa7164_dev *dev, u32 reg) 56static int saa7164_dl_wait_clr(struct saa7164_dev *dev, u32 reg)
57{ 57{
58 u32 timeout = SAA_DEVICE_TIMEOUT; 58 u32 timeout = SAA_DEVICE_TIMEOUT;
59 while (saa7164_readl(reg) & 0x01) { 59 while (saa7164_readl(reg) & 0x01) {
@@ -71,8 +71,8 @@ int saa7164_dl_wait_clr(struct saa7164_dev *dev, u32 reg)
71 71
72/* TODO: move dlflags into dev-> and change to write/readl/b */ 72/* TODO: move dlflags into dev-> and change to write/readl/b */
73/* TODO: Excessive levels of debug */ 73/* TODO: Excessive levels of debug */
74int saa7164_downloadimage(struct saa7164_dev *dev, u8 *src, u32 srcsize, 74static int saa7164_downloadimage(struct saa7164_dev *dev, u8 *src, u32 srcsize,
75 u32 dlflags, u8 *dst, u32 dstsize) 75 u32 dlflags, u8 *dst, u32 dstsize)
76{ 76{
77 u32 reg, timeout, offset; 77 u32 reg, timeout, offset;
78 u8 *srcbuf = NULL; 78 u8 *srcbuf = NULL;
diff --git a/drivers/media/pci/saa7164/saa7164-vbi.c b/drivers/media/pci/saa7164/saa7164-vbi.c
index d8e6c8f14079..b4532299c0ed 100644
--- a/drivers/media/pci/saa7164/saa7164-vbi.c
+++ b/drivers/media/pci/saa7164/saa7164-vbi.c
@@ -984,7 +984,8 @@ out:
984 return ret; 984 return ret;
985} 985}
986 986
987int saa7164_vbi_fmt(struct file *file, void *priv, struct v4l2_format *f) 987static int saa7164_vbi_fmt(struct file *file, void *priv,
988 struct v4l2_format *f)
988{ 989{
989 /* ntsc */ 990 /* ntsc */
990 f->fmt.vbi.samples_per_line = 1600; 991 f->fmt.vbi.samples_per_line = 1600;
@@ -1047,7 +1048,8 @@ static int fops_release(struct file *file)
1047 return 0; 1048 return 0;
1048} 1049}
1049 1050
1050struct saa7164_user_buffer *saa7164_vbi_next_buf(struct saa7164_port *port) 1051static struct
1052saa7164_user_buffer *saa7164_vbi_next_buf(struct saa7164_port *port)
1051{ 1053{
1052 struct saa7164_user_buffer *ubuf = NULL; 1054 struct saa7164_user_buffer *ubuf = NULL;
1053 struct saa7164_dev *dev = port->dev; 1055 struct saa7164_dev *dev = port->dev;
diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c
index 4c10205264d4..27ae48842656 100644
--- a/drivers/media/pci/sta2x11/sta2x11_vip.c
+++ b/drivers/media/pci/sta2x11/sta2x11_vip.c
@@ -1205,8 +1205,8 @@ static void vip_gpio_release(struct device *dev, int pin, const char *name)
1205 * 1205 *
1206 * -ENODEV, device could not be detected or registered 1206 * -ENODEV, device could not be detected or registered
1207 */ 1207 */
1208static int __devinit sta2x11_vip_init_one(struct pci_dev *pdev, 1208static int sta2x11_vip_init_one(struct pci_dev *pdev,
1209 const struct pci_device_id *ent) 1209 const struct pci_device_id *ent)
1210{ 1210{
1211 int ret; 1211 int ret;
1212 struct sta2x11_vip *vip; 1212 struct sta2x11_vip *vip;
@@ -1376,7 +1376,7 @@ disable:
1376 * free memory 1376 * free memory
1377 * free GPIO pins 1377 * free GPIO pins
1378 */ 1378 */
1379static void __devexit sta2x11_vip_remove_one(struct pci_dev *pdev) 1379static void sta2x11_vip_remove_one(struct pci_dev *pdev)
1380{ 1380{
1381 struct v4l2_device *v4l2_dev = pci_get_drvdata(pdev); 1381 struct v4l2_device *v4l2_dev = pci_get_drvdata(pdev);
1382 struct sta2x11_vip *vip = 1382 struct sta2x11_vip *vip =
@@ -1517,7 +1517,7 @@ static DEFINE_PCI_DEVICE_TABLE(sta2x11_vip_pci_tbl) = {
1517static struct pci_driver sta2x11_vip_driver = { 1517static struct pci_driver sta2x11_vip_driver = {
1518 .name = DRV_NAME, 1518 .name = DRV_NAME,
1519 .probe = sta2x11_vip_init_one, 1519 .probe = sta2x11_vip_init_one,
1520 .remove = __devexit_p(sta2x11_vip_remove_one), 1520 .remove = sta2x11_vip_remove_one,
1521 .id_table = sta2x11_vip_pci_tbl, 1521 .id_table = sta2x11_vip_pci_tbl,
1522#ifdef CONFIG_PM 1522#ifdef CONFIG_PM
1523 .suspend = sta2x11_vip_suspend, 1523 .suspend = sta2x11_vip_suspend,
diff --git a/drivers/media/pci/ttpci/av7110.c b/drivers/media/pci/ttpci/av7110.c
index 4bd8bd56befc..4656d4a10af0 100644
--- a/drivers/media/pci/ttpci/av7110.c
+++ b/drivers/media/pci/ttpci/av7110.c
@@ -2367,8 +2367,8 @@ static int frontend_init(struct av7110 *av7110)
2367 * The same behaviour of missing VSYNC can be duplicated on budget 2367 * The same behaviour of missing VSYNC can be duplicated on budget
2368 * cards, by seting DD1_INIT trigger mode 7 in 3rd nibble. 2368 * cards, by seting DD1_INIT trigger mode 7 in 3rd nibble.
2369 */ 2369 */
2370static int __devinit av7110_attach(struct saa7146_dev* dev, 2370static int av7110_attach(struct saa7146_dev* dev,
2371 struct saa7146_pci_extension_data *pci_ext) 2371 struct saa7146_pci_extension_data *pci_ext)
2372{ 2372{
2373 const int length = TS_WIDTH * TS_HEIGHT; 2373 const int length = TS_WIDTH * TS_HEIGHT;
2374 struct pci_dev *pdev = dev->pci; 2374 struct pci_dev *pdev = dev->pci;
@@ -2761,7 +2761,7 @@ err_kfree_0:
2761 goto out; 2761 goto out;
2762} 2762}
2763 2763
2764static int __devexit av7110_detach(struct saa7146_dev* saa) 2764static int av7110_detach(struct saa7146_dev* saa)
2765{ 2765{
2766 struct av7110 *av7110 = saa->ext_priv; 2766 struct av7110 *av7110 = saa->ext_priv;
2767 dprintk(4, "%p\n", av7110); 2767 dprintk(4, "%p\n", av7110);
@@ -2910,7 +2910,7 @@ static struct saa7146_extension av7110_extension_driver = {
2910 .module = THIS_MODULE, 2910 .module = THIS_MODULE,
2911 .pci_tbl = &pci_tbl[0], 2911 .pci_tbl = &pci_tbl[0],
2912 .attach = av7110_attach, 2912 .attach = av7110_attach,
2913 .detach = __devexit_p(av7110_detach), 2913 .detach = av7110_detach,
2914 2914
2915 .irq_mask = MASK_19 | MASK_03 | MASK_10, 2915 .irq_mask = MASK_19 | MASK_03 | MASK_10,
2916 .irq_func = av7110_irq, 2916 .irq_func = av7110_irq,
diff --git a/drivers/media/pci/ttpci/av7110.h b/drivers/media/pci/ttpci/av7110.h
index 88b3b2d6cc0e..a378662b1dcf 100644
--- a/drivers/media/pci/ttpci/av7110.h
+++ b/drivers/media/pci/ttpci/av7110.h
@@ -6,6 +6,7 @@
6#include <linux/netdevice.h> 6#include <linux/netdevice.h>
7#include <linux/i2c.h> 7#include <linux/i2c.h>
8#include <linux/input.h> 8#include <linux/input.h>
9#include <linux/time.h>
9 10
10#include <linux/dvb/video.h> 11#include <linux/dvb/video.h>
11#include <linux/dvb/audio.h> 12#include <linux/dvb/audio.h>
diff --git a/drivers/media/pci/ttpci/av7110_ir.c b/drivers/media/pci/ttpci/av7110_ir.c
index 908f272fe26c..eb822862a646 100644
--- a/drivers/media/pci/ttpci/av7110_ir.c
+++ b/drivers/media/pci/ttpci/av7110_ir.c
@@ -324,7 +324,7 @@ static void ir_handler(struct av7110 *av7110, u32 ircom)
324} 324}
325 325
326 326
327int __devinit av7110_ir_init(struct av7110 *av7110) 327int av7110_ir_init(struct av7110 *av7110)
328{ 328{
329 struct input_dev *input_dev; 329 struct input_dev *input_dev;
330 static struct proc_dir_entry *e; 330 static struct proc_dir_entry *e;
@@ -385,7 +385,7 @@ int __devinit av7110_ir_init(struct av7110 *av7110)
385} 385}
386 386
387 387
388void __devexit av7110_ir_exit(struct av7110 *av7110) 388void av7110_ir_exit(struct av7110 *av7110)
389{ 389{
390 int i; 390 int i;
391 391
diff --git a/drivers/media/pci/ttpci/budget-av.c b/drivers/media/pci/ttpci/budget-av.c
index 12ddb53c58dc..1f8b1bb0bf9f 100644
--- a/drivers/media/pci/ttpci/budget-av.c
+++ b/drivers/media/pci/ttpci/budget-av.c
@@ -1477,8 +1477,8 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
1477 1477
1478 if (saa7113_init(budget_av) == 0) { 1478 if (saa7113_init(budget_av) == 0) {
1479 budget_av->has_saa7113 = 1; 1479 budget_av->has_saa7113 = 1;
1480 1480 err = saa7146_vv_init(dev, &vv_data);
1481 if (0 != saa7146_vv_init(dev, &vv_data)) { 1481 if (err != 0) {
1482 /* fixme: proper cleanup here */ 1482 /* fixme: proper cleanup here */
1483 ERR("cannot init vv subsystem\n"); 1483 ERR("cannot init vv subsystem\n");
1484 return err; 1484 return err;
diff --git a/drivers/media/pci/zoran/zoran_card.c b/drivers/media/pci/zoran/zoran_card.c
index fffc54b452c8..a90a3b9b09bf 100644
--- a/drivers/media/pci/zoran/zoran_card.c
+++ b/drivers/media/pci/zoran/zoran_card.c
@@ -369,7 +369,7 @@ static const unsigned short bt819_addrs[] = { 0x45, I2C_CLIENT_END };
369static const unsigned short bt856_addrs[] = { 0x44, I2C_CLIENT_END }; 369static const unsigned short bt856_addrs[] = { 0x44, I2C_CLIENT_END };
370static const unsigned short bt866_addrs[] = { 0x44, I2C_CLIENT_END }; 370static const unsigned short bt866_addrs[] = { 0x44, I2C_CLIENT_END };
371 371
372static struct card_info zoran_cards[NUM_CARDS] __devinitdata = { 372static struct card_info zoran_cards[NUM_CARDS] = {
373 { 373 {
374 .type = DC10_old, 374 .type = DC10_old,
375 .name = "DC10(old)", 375 .name = "DC10(old)",
@@ -948,8 +948,7 @@ zoran_open_init_params (struct zoran *zr)
948 zr->testing = 0; 948 zr->testing = 0;
949} 949}
950 950
951static void __devinit 951static void test_interrupts (struct zoran *zr)
952test_interrupts (struct zoran *zr)
953{ 952{
954 DEFINE_WAIT(wait); 953 DEFINE_WAIT(wait);
955 int timeout, icr; 954 int timeout, icr;
@@ -974,8 +973,7 @@ test_interrupts (struct zoran *zr)
974 btwrite(icr, ZR36057_ICR); 973 btwrite(icr, ZR36057_ICR);
975} 974}
976 975
977static int __devinit 976static int zr36057_init (struct zoran *zr)
978zr36057_init (struct zoran *zr)
979{ 977{
980 int j, err; 978 int j, err;
981 979
@@ -1083,7 +1081,7 @@ exit_free:
1083 return err; 1081 return err;
1084} 1082}
1085 1083
1086static void __devexit zoran_remove(struct pci_dev *pdev) 1084static void zoran_remove(struct pci_dev *pdev)
1087{ 1085{
1088 struct v4l2_device *v4l2_dev = dev_get_drvdata(&pdev->dev); 1086 struct v4l2_device *v4l2_dev = dev_get_drvdata(&pdev->dev);
1089 struct zoran *zr = to_zoran(v4l2_dev); 1087 struct zoran *zr = to_zoran(v4l2_dev);
@@ -1129,9 +1127,8 @@ zoran_vdev_release (struct video_device *vdev)
1129 kfree(vdev); 1127 kfree(vdev);
1130} 1128}
1131 1129
1132static struct videocodec_master * __devinit 1130static struct videocodec_master *zoran_setup_videocodec(struct zoran *zr,
1133zoran_setup_videocodec (struct zoran *zr, 1131 int type)
1134 int type)
1135{ 1132{
1136 struct videocodec_master *m = NULL; 1133 struct videocodec_master *m = NULL;
1137 1134
@@ -1192,8 +1189,7 @@ static void zoran_subdev_notify(struct v4l2_subdev *sd, unsigned int cmd, void *
1192 * Scan for a Buz card (actually for the PCI controller ZR36057), 1189 * Scan for a Buz card (actually for the PCI controller ZR36057),
1193 * request the irq and map the io memory 1190 * request the irq and map the io memory
1194 */ 1191 */
1195static int __devinit zoran_probe(struct pci_dev *pdev, 1192static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1196 const struct pci_device_id *ent)
1197{ 1193{
1198 unsigned char latency, need_latency; 1194 unsigned char latency, need_latency;
1199 struct zoran *zr; 1195 struct zoran *zr;
@@ -1459,7 +1455,7 @@ static struct pci_driver zoran_driver = {
1459 .name = "zr36067", 1455 .name = "zr36067",
1460 .id_table = zr36067_pci_tbl, 1456 .id_table = zr36067_pci_tbl,
1461 .probe = zoran_probe, 1457 .probe = zoran_probe,
1462 .remove = __devexit_p(zoran_remove), 1458 .remove = zoran_remove,
1463}; 1459};
1464 1460
1465static int __init zoran_init(void) 1461static int __init zoran_init(void)
diff --git a/drivers/media/pci/zoran/zoran_driver.c b/drivers/media/pci/zoran/zoran_driver.c
index 53f12c7466b0..e60ae41e2319 100644
--- a/drivers/media/pci/zoran/zoran_driver.c
+++ b/drivers/media/pci/zoran/zoran_driver.c
@@ -3080,7 +3080,7 @@ static const struct v4l2_file_operations zoran_fops = {
3080 .poll = zoran_poll, 3080 .poll = zoran_poll,
3081}; 3081};
3082 3082
3083struct video_device zoran_template __devinitdata = { 3083struct video_device zoran_template = {
3084 .name = ZORAN_NAME, 3084 .name = ZORAN_NAME,
3085 .fops = &zoran_fops, 3085 .fops = &zoran_fops,
3086 .ioctl_ops = &zoran_ioctl_ops, 3086 .ioctl_ops = &zoran_ioctl_ops,