case DMX_GET_CAPS: if (!dmxdev->demux->get_caps) { ret = -EINVAL; break; } ret = dmxdev->demux->get_caps(dmxdev->demux, parg); break;  case DMX_SET_SOURCE: if (!dmxdev->demux->set_source) { ret = -EINVAL; break; } ret = dmxdev->demux->set_source(dmxdev->demux, parg); break;  
static int dvb_demux_do_ioctl(struct inode *inode, struct file *file,			      unsigned int cmd, void *parg){	struct dmxdev_filter *dmxdevfilter = file->private_data;	struct dmxdev *dmxdev=dmxdevfilter->dev;	unsigned long arg=(unsigned long) parg;	int ret=0;	if (down_interruptible (&dmxdev->mutex))		return -ERESTARTSYS;	switch (cmd) {	case DMX_START:		if (down_interruptible(&dmxdevfilter->mutex)) {			up(&dmxdev->mutex);			return -ERESTARTSYS;		}		if (dmxdevfilter->state<DMXDEV_STATE_SET)			ret = -EINVAL;		else			ret = dvb_dmxdev_filter_start(dmxdevfilter);		up(&dmxdevfilter->mutex);		break;	case DMX_STOP:		if (down_interruptible(&dmxdevfilter->mutex)) {			up(&dmxdev->mutex);			return -ERESTARTSYS;		}		ret=dvb_dmxdev_filter_stop(dmxdevfilter);		up(&dmxdevfilter->mutex);		break;	case DMX_SET_FILTER:		if (down_interruptible(&dmxdevfilter->mutex)) {			up(&dmxdev->mutex);			return -ERESTARTSYS;		}		ret = dvb_dmxdev_filter_set(dmxdev, dmxdevfilter,				    (struct dmx_sct_filter_params *)parg);		up(&dmxdevfilter->mutex);		break;	case DMX_SET_PES_FILTER:		if (down_interruptible(&dmxdevfilter->mutex)) {			up(&dmxdev->mutex);			return -ERESTARTSYS;		}		ret=dvb_dmxdev_pes_filter_set(dmxdev, dmxdevfilter,					       (struct dmx_pes_filter_params *)parg);		up(&dmxdevfilter->mutex);		break;	case DMX_SET_BUFFER_SIZE:		if (down_interruptible(&dmxdevfilter->mutex)) {			up(&dmxdev->mutex);			return -ERESTARTSYS;		}		ret=dvb_dmxdev_set_buffer_size(dmxdevfilter, arg);		up(&dmxdevfilter->mutex);		break;	case DMX_GET_EVENT:		break;	case DMX_GET_PES_PIDS:		if (!dmxdev->demux->get_pes_pids) {			ret=-EINVAL;			break;		}		dmxdev->demux->get_pes_pids(dmxdev->demux, (u16 *)parg);		break;	case DMX_GET_STC:		if (!dmxdev->demux->get_stc) {		        ret=-EINVAL;			break;		}		ret = dmxdev->demux->get_stc(dmxdev->demux,				((struct dmx_stc *)parg)->num,				&((struct dmx_stc *)parg)->stc,				&((struct dmx_stc *)parg)->base);		break;	default:		ret=-EINVAL;	}	up(&dmxdev->mutex);	return ret;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/c05100528efe997a27d841230f9f5b2f4adf3d0f/dmxdev.c/buggy/drivers/media/dvb/dvb-core/dmxdev.c