Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a9ec373 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] v4l2-ctrls: use ptrs for all but the s32 type



Rather than having two unions for all types just keep 'val' and
'cur.val' and use the p_cur and p_new unions to access all others.

The only reason for keeping 'val' and 'cur.val' is that it is used
all over, so converting this as well would be a huge job.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 9ea1b7a4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -362,7 +362,7 @@ will result in a deadlock since these helpers lock the handler as well.
You can also take the handler lock yourself:

	mutex_lock(&state->ctrl_handler.lock);
	printk(KERN_INFO "String value is '%s'\n", ctrl1->cur.string);
	pr_info("String value is '%s'\n", ctrl1->p_cur.p_char);
	printk(KERN_INFO "Integer value is '%s'\n", ctrl2->cur.val);
	mutex_unlock(&state->ctrl_handler.lock);

+1 −1
Original line number Diff line number Diff line
@@ -667,7 +667,7 @@ static int mt9v032_s_ctrl(struct v4l2_ctrl *ctrl)
			break;

		freq = mt9v032->pdata->link_freqs[mt9v032->link_freq->val];
		mt9v032->pixel_rate->val64 = freq;
		*mt9v032->pixel_rate->p_new.p_s64 = freq;
		mt9v032->sysclk = freq;
		break;

+2 −2
Original line number Diff line number Diff line
@@ -297,8 +297,8 @@ static int smiapp_pll_update(struct smiapp_sensor *sensor)
	if (rval < 0)
		return rval;

	sensor->pixel_rate_parray->cur.val64 = pll->vt_pix_clk_freq_hz;
	sensor->pixel_rate_csi->cur.val64 = pll->pixel_rate_csi;
	*sensor->pixel_rate_parray->p_cur.p_s64 = pll->vt_pix_clk_freq_hz;
	*sensor->pixel_rate_csi->p_cur.p_s64 = pll->pixel_rate_csi;

	return 0;
}
+2 −2
Original line number Diff line number Diff line
@@ -135,8 +135,8 @@ static int ivtv_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
	/* V4L2_CID_MPEG_VIDEO_DEC_PTS and V4L2_CID_MPEG_VIDEO_DEC_FRAME
	   control cluster */
	case V4L2_CID_MPEG_VIDEO_DEC_PTS:
		return ivtv_g_pts_frame(itv, &itv->ctrl_pts->val64,
					     &itv->ctrl_frame->val64);
		return ivtv_g_pts_frame(itv, itv->ctrl_pts->p_new.p_s64,
					     itv->ctrl_frame->p_new.p_s64);
	}
	return 0;
}
+2 −2
Original line number Diff line number Diff line
@@ -648,13 +648,13 @@ static void vivi_fillbuff(struct vivi_dev *dev, struct vivi_buffer *buf)
	gen_text(dev, vbuf, line++ * 16, 16, str);
	snprintf(str, sizeof(str), " int32 %d, int64 %lld, bitmask %08x ",
			dev->int32->cur.val,
			dev->int64->cur.val64,
			*dev->int64->p_cur.p_s64,
			dev->bitmask->cur.val);
	gen_text(dev, vbuf, line++ * 16, 16, str);
	snprintf(str, sizeof(str), " boolean %d, menu %s, string \"%s\" ",
			dev->boolean->cur.val,
			dev->menu->qmenu[dev->menu->cur.val],
			dev->string->cur.string);
			dev->string->p_cur.p_char);
	gen_text(dev, vbuf, line++ * 16, 16, str);
	snprintf(str, sizeof(str), " integer_menu %lld, value %d ",
			dev->int_menu->qmenu_int[dev->int_menu->cur.val],
Loading