/* From here on down is the code for translating the numerous ioctl commands from the old API to the new API.  */
static int get_v4l_control(struct file *file, int cid, v4l2_kioctl drv)
/* From here on down is the code for translating the numerous ioctl commands from the old API to the new API.  */
static int get_v4l_control(struct file *file, int cid, v4l2_kioctl drv)
{
	struct v4l2_queryctrl	qctrl2;
	struct v4l2_control	ctrl2;
	int			err;
	qctrl2.id = cid;
	err = drv(file, VIDIOC_QUERYCTRL, &qctrl2);
	if (err < 0)
		dprintk("VIDIOC_QUERYCTRL: %d\n", err);
	if (err == 0 && !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED)) {
		ctrl2.id = qctrl2.id;
		err = drv(file, VIDIOC_G_CTRL, &ctrl2);
		if (err < 0) {
			dprintk("VIDIOC_G_CTRL: %d\n", err);
			return 0;
		}
		return DIV_ROUND_CLOSEST((ctrl2.value-qctrl2.minimum) * 65535,
					 qctrl2.maximum - qctrl2.minimum);
	}
	return 0;
}