*/
static void mxc_v4l2_master_detach(struct v4l2_int_device *slave)
{
+ unsigned int i;
+ cam_data *cam = slave->u.slave->master->priv;
+
pr_debug("In MVC:mxc_v4l2_master_detach\n");
+
+ if (sensor_index > 1) {
+ for (i = 0; i < sensor_index; i++) {
+ if (cam->all_sensors[i] != slave)
+ continue;
+ /* Move all the sensors behind this
+ * sensor one step forward
+ */
+ for (; i < sensor_index - 1; i++)
+ cam->all_sensors[i] = cam->all_sensors[i+1];
+ break;
+ }
+ /* Point current sensor to the last one */
+ cam->sensor = cam->all_sensors[sensor_index - 2];
+ } else
+ cam->sensor = NULL;
+
+ sensor_index--;
vidioc_int_dev_exit(slave);
}