Video4Linux cleanup
Subsystems (7)
Media (V4L/DVB) USB Cadet FM/am radio receiver driver Gemtek FM radio receiver driver +3 more subsystems
PATCH 1/1 Video4Linux cleanup
Patch against test11-pre6
- Converts struct video_device to named initializers
- Fixes radio-maestro init
- Removes superfluous initialize functions (those that just return 0)
Signature · 1 line
Brian Gerst
drivers/media/radio/radio-aimslab.c +6 -11
@@ -322,17 +322,12 @@static struct video_device rtrack_radio= { -"RadioTrack radio" , -VID_TYPE_TUNER , -VID_HARDWARE_RTRACK , - rt_open, - rt_close, -NULL ,/* Can't read (no capture ability) */ -NULL ,/* Can't write */ -NULL ,/* No poll */ - rt_ioctl, -NULL , -NULL + name:"RadioTrack radio" , + type:VID_TYPE_TUNER , + hardware:VID_HARDWARE_RTRACK , + open: rt_open, + close: rt_close, + ioctl: rt_ioctl, };static int __init rtrack_init (void )
drivers/media/radio/radio-aztech.c +6 -11
@@ -273,17 +273,12 @@static struct video_device aztech_radio= { -"Aztech radio" , -VID_TYPE_TUNER , -VID_HARDWARE_AZTECH , - az_open, - az_close, -NULL ,/* Can't read (no capture ability) */ -NULL ,/* Can't write */ -NULL ,/* No poll */ - az_ioctl, -NULL , -NULL + name:"Aztech radio" , + type:VID_TYPE_TUNER , + hardware:VID_HARDWARE_AZTECH , + open: az_open, + close: az_close, + ioctl: az_ioctl, };static int __init aztech_init (void )
drivers/media/radio/radio-cadet.c +7 -11
@@ -542,17 +542,13 @@static struct video_device cadet_radio= { -"Cadet radio" , -VID_TYPE_TUNER , -VID_HARDWARE_CADET , - cadet_open, - cadet_close, - cadet_read, -NULL ,/* Can't write */ -NULL ,/* No poll */ - cadet_ioctl, -NULL , -NULL + name:"Cadet radio" , + type:VID_TYPE_TUNER , + hardware:VID_HARDWARE_CADET , + open: cadet_open, + close: cadet_close, + read: cadet_read, + ioctl: cadet_ioctl, };#ifdef CONFIG_ISAPNP
drivers/media/radio/radio-gemtek.c +6 -11
@@ -249,17 +249,12 @@static struct video_device gemtek_radio= { -"GemTek radio" , -VID_TYPE_TUNER , -VID_HARDWARE_GEMTEK , - gemtek_open, - gemtek_close, -NULL ,/* Can't read (no capture ability) */ -NULL ,/* Can't write */ -NULL ,/* Can't poll */ - gemtek_ioctl, -NULL , -NULL + name:"GemTek radio" , + type:VID_TYPE_TUNER , + hardware:VID_HARDWARE_GEMTEK , + open: gemtek_open, + close: gemtek_close, + ioctl: gemtek_ioctl, };static int __init gemtek_init (void )
drivers/media/radio/radio-maestro.c +11 -17
@@ -69,17 +69,12 @@static struct video_device maestro_radio= { -"Maestro radio" , -VID_TYPE_TUNER , -VID_HARDWARE_SF16MI , - radio_open, - radio_close, -NULL , -NULL , -NULL , - radio_ioctl, -NULL , -NULL + name:"Maestro radio" , + type:VID_TYPE_TUNER , + hardware:VID_HARDWARE_SF16MI , + open: radio_open, + close: radio_close, + ioctl: radio_ioctl, }; static struct radio_device
@@ -300,21 +295,17 @@inline static __u16 radio_install (struct pci_dev *pcidev); -#ifdef MODULE MODULE_AUTHOR ("Adam Tlalka, [email protected]" );MODULE_DESCRIPTION ("Radio driver for the Maestro PCI sound card radio." );EXPORT_NO_SYMBOLS ; -void cleanup_module (void ) +void __exit maestro_radio_exit(void) {video_unregister_device (&maestro_radio); } -int init_module(void) -#else -int __init maestro_radio_init(struct video_init *v) -#endif +int __init maestro_radio_init (void ) { register__u16 found=0 ;struct pci_dev *pcidev =NULL ;
@@ -334,6 +325,9 @@ }return 0 ; } + +module_init (maestro_radio_init); +module_exit (maestro_radio_exit);inline static __u16 radio_power_on (struct radio_device *dev) {
drivers/media/radio/radio-miropcm20.c +6 -11
@@ -192,17 +192,12 @@static struct video_device pcm20_radio= { -"Miro PCM 20 radio" , -VID_TYPE_TUNER , -VID_HARDWARE_RTRACK , - pcm20_open, - pcm20_close, -NULL ,/* Can't read (no capture ability) */ -NULL ,/* Can't write */ -NULL ,/* Can't poll */ - pcm20_ioctl, -NULL , -NULL + name:"Miro PCM 20 radio" , + type:VID_TYPE_TUNER , + hardware:VID_HARDWARE_RTRACK , + open: pcm20_open, + close: pcm20_close, + ioctl: pcm20_ioctl, };static int __init pcm20_init (void )
drivers/media/radio/radio-rtrack2.c +6 -11
@@ -215,17 +215,12 @@static struct video_device rtrack2_radio= { -"RadioTrack II radio" , -VID_TYPE_TUNER , -VID_HARDWARE_RTRACK2 , - rt_open, - rt_close, -NULL ,/* Can't read (no capture ability) */ -NULL ,/* Can't write */ -NULL ,/* Can't poll */ - rt_ioctl, -NULL , -NULL + name:"RadioTrack II radio" , + type:VID_TYPE_TUNER , + hardware:VID_HARDWARE_RTRACK2 , + open: rt_open, + close: rt_close, + ioctl: rt_ioctl, };static int __init rtrack2_init (void )
drivers/media/radio/radio-sf16fmi.c +6 -11
@@ -276,17 +276,12 @@static struct video_device fmi_radio= { -"SF16FMx radio" , -VID_TYPE_TUNER , -VID_HARDWARE_SF16MI , - fmi_open, - fmi_close, -NULL ,/* Can't read (no capture ability) */ -NULL ,/* Can't write */ -NULL ,/* Can't poll */ - fmi_ioctl, -NULL , -NULL + name:"SF16FMx radio" , + type:VID_TYPE_TUNER , + hardware:VID_HARDWARE_SF16MI , + open: fmi_open, + close: fmi_close, + ioctl: fmi_ioctl, };static int __init fmi_init (void )
drivers/media/radio/radio-terratec.c +6 -11
@@ -294,17 +294,12 @@static struct video_device terratec_radio= { -"TerraTec ActiveRadio" , -VID_TYPE_TUNER , -VID_HARDWARE_TERRATEC , - tt_open, - tt_close, -NULL ,/* Can't read (no capture ability) */ -NULL ,/* Can't write */ -NULL ,/* No poll */ - tt_ioctl, -NULL , -NULL + name:"TerraTec ActiveRadio" , + type:VID_TYPE_TUNER , + hardware:VID_HARDWARE_TERRATEC , + open: tt_open, + close: tt_close, + ioctl: tt_ioctl, };static int __init terratec_init (void )
drivers/media/radio/radio-trust.c +6 -11
@@ -286,17 +286,12 @@static struct video_device trust_radio= { -"Trust FM Radio" , -VID_TYPE_TUNER , -VID_HARDWARE_TRUST , - tr_open, - tr_close, -NULL ,/* Can't read (no capture ability) */ -NULL ,/* Can't write */ -NULL ,/* No poll */ - tr_ioctl, -NULL , -NULL + name:"Trust FM Radio" , + type:VID_TYPE_TUNER , + hardware:VID_HARDWARE_TRUST , + open: tr_open, + close: tr_close, + ioctl: tr_ioctl, };static int __init trust_init (void )
drivers/media/radio/radio-typhoon.c +9 -17
@@ -273,27 +273,19 @@static struct typhoon_device typhoon_unit = { -0 ,/* users */ -CONFIG_RADIO_TYPHOON_PORT ,/* iobase */ -0 ,/* curvol */ -0 ,/* muted */ -CONFIG_RADIO_TYPHOON_MUTEFREQ ,/* curfreq */ -CONFIG_RADIO_TYPHOON_MUTEFREQ /* mutefreq */ + iobase:CONFIG_RADIO_TYPHOON_PORT , + curfreq:CONFIG_RADIO_TYPHOON_MUTEFREQ , + mutefreq:CONFIG_RADIO_TYPHOON_MUTEFREQ , };static struct video_device typhoon_radio = { -"Typhoon Radio" , -VID_TYPE_TUNER , -VID_HARDWARE_TYPHOON , - typhoon_open, - typhoon_close, -NULL ,/* Can't read (no capture ability) */ -NULL ,/* Can't write */ -NULL ,/* Can't poll */ - typhoon_ioctl, -NULL , -NULL + name:"Typhoon Radio" , + type:VID_TYPE_TUNER , + hardware:VID_HARDWARE_TYPHOON , + open: typhoon_open, + close: typhoon_close, + ioctl: typhoon_ioctl, };#ifdef CONFIG_RADIO_TYPHOON_PROC_FS
drivers/media/radio/radio-zoltrix.c +6 -11
@@ -341,17 +341,12 @@static struct video_device zoltrix_radio = { -"Zoltrix Radio Plus" , -VID_TYPE_TUNER , -VID_HARDWARE_ZOLTRIX , - zol_open, - zol_close, -NULL ,/* Can't read (no capture ability) */ -NULL ,/* Can't write */ -NULL , - zol_ioctl, -NULL , -NULL + name:"Zoltrix Radio Plus" , + type:VID_TYPE_TUNER , + hardware:VID_HARDWARE_ZOLTRIX , + open: zol_open, + close: zol_close, + ioctl: zol_ioctl, };static int __init zoltrix_init (void )
drivers/media/video/bttv-driver.c +29 -47
100 lines not on this page · raw message
drivers/media/video/buz.c +10 -20
@@ -3027,28 +3027,18 @@return 0 ; } -static int zoran_init_done (struct video_device *dev) -{ -return 0 ; -} -static struct video_device zoran_template = { -BUZ_NAME , -VID_TYPE_CAPTURE |VID_TYPE_OVERLAY |VID_TYPE_CLIPPING |VID_TYPE_FRAMERAM | -VID_TYPE_SCALES |VID_TYPE_SUBCAPTURE , -VID_HARDWARE_ZR36067 , - zoran_open, - zoran_close, - zoran_read, - zoran_write, -NULL , - zoran_ioctl, - zoran_mmap, - zoran_init_done, -NULL , -0 , -0 + name:BUZ_NAME , + type:VID_TYPE_CAPTURE |VID_TYPE_OVERLAY |VID_TYPE_CLIPPING |VID_TYPE_FRAMERAM | +VID_TYPE_SCALES |VID_TYPE_SUBCAPTURE , + hardware:VID_HARDWARE_ZR36067 , + open: zoran_open, + close: zoran_close, + read: zoran_read, + write: zoran_write, + ioctl: zoran_ioctl, + mmap: zoran_mmap, };static int zr36057_init (int i)
drivers/media/video/bw-qcam.c +8 -19
@@ -705,11 +705,6 @@MOD_DEC_USE_COUNT ; } -static int qcam_init_done (struct video_device *dev) -{ -return 0 ; -} -static long qcam_write (struct video_device *v,const char *buf,unsigned long count,int noblock) {return -EINVAL ;
@@ -926,20 +921,14 @@static struct video_device qcam_template= { -"Connectix Quickcam" , -VID_TYPE_CAPTURE , -VID_HARDWARE_QCAM_BW , - qcam_open, - qcam_close, - qcam_read, - qcam_write, -NULL , - qcam_ioctl, -NULL , - qcam_init_done, -NULL , -0 , -0 + name:"Connectix Quickcam" , + type:VID_TYPE_CAPTURE , + hardware:VID_HARDWARE_QCAM_BW , + open: qcam_open, + close: qcam_close, + read: qcam_read, + write: qcam_write, + ioctl: qcam_ioctl, };#define MAX_CAMS 4
drivers/media/video/c-qcam.c +8 -19
@@ -509,11 +509,6 @@MOD_DEC_USE_COUNT ; } -static int qcam_init_done (struct video_device *dev) -{ -return 0 ; -} -static long qcam_write (struct video_device *v,const char *buf,unsigned long count,int noblock) {return -EINVAL ;
@@ -733,20 +728,14 @@/* video device template */ static struct video_device qcam_template= { -"Colour QuickCam" , -VID_TYPE_CAPTURE , -VID_HARDWARE_QCAM_C , - qcam_open, - qcam_close, - qcam_read, - qcam_write, -NULL , - qcam_ioctl, -NULL , - qcam_init_done, -NULL , -0 , -0 + name:"Colour QuickCam" , + type:VID_TYPE_CAPTURE , + hardware:VID_HARDWARE_QCAM_C , + open: qcam_open, + close: qcam_close, + read: qcam_read, + write: qcam_write, + ioctl: qcam_ioctl, };/* Initialize the QuickCam driver control structure. */
drivers/media/video/cpia.c +10 -14
@@ -3031,20 +3031,16 @@ }static struct video_device cpia_template = { -"CPiA Camera" , -VID_TYPE_CAPTURE , -VID_HARDWARE_CPIA ,/* FIXME */ - cpia_open,/* open */ - cpia_close,/* close */ - cpia_read,/* read */ -NULL ,/* no write */ -NULL ,/* no poll */ - cpia_ioctl,/* ioctl */ - cpia_mmap,/* mmap */ - cpia_video_init,/* initialize */ -NULL ,/* priv */ -0 ,/* busy */ --1 /* minor - unset */ + name:"CPiA Camera" , + type:VID_TYPE_CAPTURE , + hardware:VID_HARDWARE_CPIA ,/* FIXME */ + open: cpia_open, + close: cpia_close, + read: cpia_read, + ioctl: cpia_ioctl, + mmap: cpia_mmap, + initialize: cpia_video_init, + minor:-1 , };/* initialise cam_data structure */
drivers/media/video/planb.c +9 -23
@@ -2035,31 +2035,17 @@return 0 ; } -/* This gets called upon device registration */ -/* we could do some init here */ -static int planb_init_done (struct video_device *dev) -{ -return 0 ; -} -static struct video_device planb_template= { -PLANB_DEVICE_NAME , -VID_TYPE_OVERLAY , -VID_HARDWARE_PLANB , - planb_open, - planb_close, - planb_read, - planb_write, -#if LINUX_VERSION_CODE >= 0x020100 - NULL, /* poll */ -#endif - planb_ioctl, - planb_mmap,/* mmap? */ - planb_init_done, -NULL ,/* pointer to private data */ -0 , -0 + name:PLANB_DEVICE_NAME , + type:VID_TYPE_OVERLAY , + hardware:VID_HARDWARE_PLANB , + open: planb_open, + close: planb_close, + read: planb_read, + write: planb_write, + ioctl: planb_ioctl, + mmap: planb_mmap,/* mmap? */ };static int init_planb (struct planb *pb)
drivers/media/video/pms.c +8 -19
@@ -681,11 +681,6 @@MOD_DEC_USE_COUNT ; } -static int pms_init_done (struct video_device *dev) -{ -return 0 ; -} -static long pms_write (struct video_device *v,const char *buf,unsigned long count,int noblock) {return -EINVAL ;
@@ -907,20 +902,14 @@struct video_device pms_template= { -"Mediavision PMS" , -VID_TYPE_CAPTURE , -VID_HARDWARE_PMS , - pms_open, - pms_close, - pms_read, - pms_write, -NULL ,/* FIXME - we can use POLL on this board with the irq */ - pms_ioctl, -NULL , - pms_init_done, -NULL , -0 , -0 + name:"Mediavision PMS" , + type:VID_TYPE_CAPTURE , + hardware:VID_HARDWARE_PMS , + open: pms_open, + close: pms_close, + read: pms_read, + write: pms_write, + ioctl: pms_ioctl, };struct pms_device pms_device;
drivers/media/video/saa5249.c +7 -10
@@ -669,15 +669,12 @@static struct video_device saa_template = { -IF_NAME , -VID_TYPE_TELETEXT ,/*| VID_TYPE_TUNER ?? */ -VID_HARDWARE_SAA5249 , - saa5249_open, - saa5249_release, -NULL ,/* read */ - saa5249_write, -NULL ,/* poll */ - saa5249_ioctl, -/* the rest are null */ + name:IF_NAME , + type:VID_TYPE_TELETEXT ,/*| VID_TYPE_TUNER ?? */ + hardware:VID_HARDWARE_SAA5249 , + open: saa5249_open, + close: saa5249_release, + write: saa5249_write, + ioctl: saa5249_ioctl, };
drivers/media/video/stradis.c +9 -19
@@ -1827,11 +1827,6 @@return 0 ; } -static int saa_init_done (struct video_device *dev) -{ -return 0 ; -} -static int saa_mmap (struct video_device *dev,const char *adr,unsigned long size) {
@@ -1993,20 +1988,15 @@/* template for video_device-structure */ static struct video_device saa_template = { -"SAA7146A" , -VID_TYPE_CAPTURE |VID_TYPE_OVERLAY , -VID_HARDWARE_SAA7146 , - saa_open, - saa_close, - saa_read, - saa_write, -NULL ,/* poll */ - saa_ioctl, - saa_mmap, - saa_init_done, -NULL , -0 , -0 + name:"SAA7146A" , + type:VID_TYPE_CAPTURE |VID_TYPE_OVERLAY , + hardware:VID_HARDWARE_SAA7146 , + open: saa_open, + close: saa_close, + read: saa_read, + write: saa_write, + ioctl: saa_ioctl, + mmap: saa_mmap, };static int configure_saa7146 (struct pci_dev *dev,int num)
drivers/media/video/vino.c +7 -14
@@ -224,20 +224,13 @@ }static struct video_device vino_dev = { -"Vino IndyCam/TV" , -VID_TYPE_CAPTURE , -VID_HARDWARE_VINO , - vino_open, - vino_close, -NULL ,/* vino_read */ -NULL ,/* vino_write */ -NULL ,/* vino_poll */ - vino_ioctl, - vino_mmap, -NULL ,/* vino_init */ -NULL , -0 , -0 + name:"Vino IndyCam/TV" , + type:VID_TYPE_CAPTURE , + hardware:VID_HARDWARE_VINO , + open: vino_open, + close: vino_close, + ioctl: vino_ioctl, + mmap: vino_mmap, };int __init init_vino (struct video_device *dev)
drivers/media/video/zr36120.c +21 -34
67 lines not on this page · raw message
drivers/usb/dsbr100.c +6 -11
@@ -91,17 +91,12 @@static struct video_device usb_dsbr100_radio= { -"D-Link DSB R-100 USB radio" , -VID_TYPE_TUNER , -VID_HARDWARE_AZTECH , - usb_dsbr100_open, - usb_dsbr100_close, -NULL ,/* Can't read (no capture ability) */ -NULL ,/* Can't write */ -NULL ,/* No poll */ - usb_dsbr100_ioctl, -NULL , -NULL + name:"D-Link DSB R-100 USB radio" , + type:VID_TYPE_TUNER , + hardware:VID_HARDWARE_AZTECH , + open: usb_dsbr100_open, + close: usb_dsbr100_close, + ioctl: usb_dsbr100_ioctl, };static int users =0 ;
drivers/usb/ibmcam.c +9 -19
@@ -2492,11 +2492,6 @@MOD_DEC_USE_COUNT ; } -static int ibmcam_init_done (struct video_device *dev) -{ -return 0 ; -} -static long ibmcam_write (struct video_device *dev,const char *buf,unsigned long count,int noblock) {return -EINVAL ;
@@ -2855,20 +2850,15 @@ }static struct video_device ibmcam_template = { -"CPiA USB Camera" , -VID_TYPE_CAPTURE , -VID_HARDWARE_CPIA , - ibmcam_open, - ibmcam_close, - ibmcam_read, - ibmcam_write, -NULL , - ibmcam_ioctl, - ibmcam_mmap, - ibmcam_init_done, -NULL , -0 , -0 + name:"CPiA USB Camera" , + type:VID_TYPE_CAPTURE , + hardware:VID_HARDWARE_CPIA , + open: ibmcam_open, + close: ibmcam_close, + read: ibmcam_read, + write: ibmcam_write, + ioctl: ibmcam_ioctl, + mmap: ibmcam_mmap, };static void usb_ibmcam_configure_video (struct usb_ibmcam *ibmcam)