diff options
Diffstat (limited to 'linux/drivers/media/dvb/dvb-core/dmxdev.c')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dmxdev.c | 44 |
1 files changed, 13 insertions, 31 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dmxdev.c b/linux/drivers/media/dvb/dvb-core/dmxdev.c index b158fca78..9abef670b 100644 --- a/linux/drivers/media/dvb/dvb-core/dmxdev.c +++ b/linux/drivers/media/dvb/dvb-core/dmxdev.c @@ -35,12 +35,6 @@ #include "dmxdev.h" #include "dvb_compat.h" - -//MODULE_DESCRIPTION(""); -//MODULE_AUTHOR("Ralph Metzler, Marcus Metzler"); -//#ifdef MODULE_LICENSE -//MODULE_LICENSE("GPL"); -//#endif MODULE_PARM(debug,"i"); static int debug = 0; @@ -1027,8 +1021,7 @@ int dvb_demux_release(struct inode *inode, struct file *file) } -static -struct file_operations dvb_demux_fops = { +static struct file_operations dvb_demux_fops = { .owner = THIS_MODULE, .read = dvb_demux_read, .ioctl = dvb_demux_ioctl, @@ -1038,8 +1031,7 @@ struct file_operations dvb_demux_fops = { }; -static -struct dvb_device dvbdev_demux = { +static struct dvb_device dvbdev_demux = { .priv = 0, .users = 1, .writers = 1, @@ -1047,8 +1039,7 @@ struct dvb_device dvbdev_demux = { }; -static -int dvb_dvr_do_ioctl(struct inode *inode, struct file *file, +static int dvb_dvr_do_ioctl(struct inode *inode, struct file *file, unsigned int cmd, void *parg) { struct dvb_device *dvbdev=(struct dvb_device *) file->private_data; @@ -1073,8 +1064,7 @@ int dvb_dvr_do_ioctl(struct inode *inode, struct file *file, } -static -int dvb_dvr_ioctl(struct inode *inode, struct file *file, +static int dvb_dvr_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { return dvb_usercopy(inode, file, cmd, arg, dvb_dvr_do_ioctl); @@ -1116,7 +1106,8 @@ struct file_operations dvb_dvr_fops = { .poll = dvb_dvr_poll, }; -static struct dvb_device dvbdev_dvr = { +static +struct dvb_device dvbdev_dvr = { .priv = 0, .users = 1, .writers = 1, @@ -1126,18 +1117,16 @@ static struct dvb_device dvbdev_dvr = { int dvb_dmxdev_init(dmxdev_t *dmxdev, struct dvb_adapter *dvb_adapter) { - int i, err; + int i; - if ((err = dmxdev->demux->open(dmxdev->demux)) < 0) - return err; + if (dmxdev->demux->open(dmxdev->demux) < 0) + return -EUSERS; dmxdev->filter = vmalloc(dmxdev->filternum*sizeof(dmxdev_filter_t)); - if (!dmxdev->filter) return -ENOMEM; dmxdev->dvr = vmalloc(dmxdev->filternum*sizeof(dmxdev_dvr_t)); - if (!dmxdev->dvr) { vfree(dmxdev->filter); dmxdev->filter = NULL; @@ -1146,24 +1135,18 @@ dvb_dmxdev_init(dmxdev_t *dmxdev, struct dvb_adapter *dvb_adapter) sema_init(&dmxdev->mutex, 1); spin_lock_init(&dmxdev->lock); - for (i=0; i<dmxdev->filternum; i++) { dmxdev->filter[i].dev=dmxdev; dmxdev->filter[i].buffer.data=0; - dvb_dmxdev_filter_state_set(&dmxdev->filter[i], - DMXDEV_STATE_FREE); + dvb_dmxdev_filter_state_set(&dmxdev->filter[i], DMXDEV_STATE_FREE); dmxdev->dvr[i].dev=dmxdev; dmxdev->dvr[i].buffer.data=0; - dvb_dmxdev_filter_state_set(&dmxdev->filter[i], - DMXDEV_STATE_FREE); + dvb_dmxdev_filter_state_set(&dmxdev->filter[i], DMXDEV_STATE_FREE); dvb_dmxdev_dvr_state_set(&dmxdev->dvr[i], DMXDEV_STATE_FREE); } - dvb_register_device(dvb_adapter, &dmxdev->dvbdev, - &dvbdev_demux, dmxdev, DVB_DEVICE_DEMUX); - - dvb_register_device(dvb_adapter, &dmxdev->dvr_dvbdev, - &dvbdev_dvr, dmxdev, DVB_DEVICE_DVR); + dvb_register_device(dvb_adapter, &dmxdev->dvbdev, &dvbdev_demux, dmxdev, DVB_DEVICE_DEMUX); + dvb_register_device(dvb_adapter, &dmxdev->dvr_dvbdev, &dvbdev_dvr, dmxdev, DVB_DEVICE_DVR); dvb_dmxdev_buffer_init(&dmxdev->dvr_buffer); @@ -1185,7 +1168,6 @@ dvb_dmxdev_release(dmxdev_t *dmxdev) vfree(dmxdev->dvr); dmxdev->dvr=0; } - dmxdev->demux->close(dmxdev->demux); } |