spin_lock(&vino_drvdata->input_lock); 
spin_lock_irqsave(&vino_drvdata->input_lock, flags); 
static int vino_set_input(struct vino_channel_settings *vcs, int input){	struct vino_channel_settings *vcs2 = (vcs->channel == VINO_CHANNEL_A) ?		&vino_drvdata->b : &vino_drvdata->a;	int ret = 0;	dprintk("vino_set_input():\n");	spin_lock(&vino_drvdata->input_lock);	if (vcs->input == input)		goto out;	switch(input) {	case VINO_INPUT_COMPOSITE:	case VINO_INPUT_SVIDEO:		if (!vino_drvdata->decoder.driver) {			ret = -EINVAL;			goto out;		}		if (vino_drvdata->decoder.owner == VINO_NO_CHANNEL) {			if (i2c_use_client(vino_drvdata->decoder.driver)) {				ret = -ENODEV;				goto out;			}			vino_drvdata->decoder.owner = vcs->channel;		}		if (vino_drvdata->decoder.owner == vcs->channel) {			int saa7191_input;			int saa7191_norm;			vcs->input = input;			vcs->data_norm = VINO_DATA_NORM_PAL;			saa7191_input = vino_get_saa7191_input(vcs->input);			i2c_decoder_command(DECODER_SET_INPUT, &saa7191_input);			saa7191_norm = vino_get_saa7191_norm(vcs->data_norm);			i2c_decoder_command(DECODER_SAA7191_SET_NORM,					    &saa7191_norm);		} else {			if (vcs2->input != input) {				ret = -EBUSY;				goto out;			}			vcs->input = input;			vcs->data_norm = vcs2->data_norm;		}		if (vino_drvdata->camera.owner == vcs->channel) {			/* Transfer the ownership or release the input */			if (vcs2->input == VINO_INPUT_D1) {				vino_drvdata->camera.owner = vcs2->channel;			} else {				i2c_release_client(vino_drvdata->						   camera.driver);				vino_drvdata->camera.owner = VINO_NO_CHANNEL;			}		}		break;	case VINO_INPUT_D1:		if (!vino_drvdata->camera.driver) {			ret = -EINVAL;			goto out;		}		if (vino_drvdata->camera.owner == VINO_NO_CHANNEL) {			if (i2c_use_client(vino_drvdata->camera.driver)) {				ret = -ENODEV;				goto out;			}			vino_drvdata->camera.owner = vcs->channel;		}		if (vino_drvdata->decoder.owner == vcs->channel) {			/* Transfer the ownership or release the input */			if ((vcs2->input == VINO_INPUT_COMPOSITE) ||				 (vcs2->input == VINO_INPUT_SVIDEO)) {				vino_drvdata->decoder.owner = vcs2->channel;			} else {				i2c_release_client(vino_drvdata->						   decoder.driver);				vino_drvdata->decoder.owner = VINO_NO_CHANNEL;			}		}		vcs->input = input;		vcs->data_norm = VINO_DATA_NORM_D1;		break;	default:		ret = -EINVAL;		goto out;	}	vino_set_default_clipping(vcs);	vino_set_default_framerate(vcs);	dprintk("vino_set_input(): %s\n", vino_inputs[vcs->input].name);out:	spin_unlock(&vino_drvdata->input_lock);	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/a637a114f36b94a1ad8b9867f43bac0414958420/vino.c/buggy/drivers/media/video/vino.c