mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 12:35:52 +02:00
media: i2c: ov01a10: Move setting of ctrl->flags to after checking ctrl_hdlr->error
Instead of checking successful creation of the link_freq and vblank controls, set their flags after checking ctrl_hdlr->error where it is guaranteed that the controls will exist. Signed-off-by: Hans de Goede <hansg@kernel.org> Tested-by: Mehdi Djait <mehdi.djait@linux.intel.com> # Dell XPS 9315 Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
82d1ab15cb
commit
7f0912eaca
|
|
@ -460,8 +460,6 @@ static int ov01a10_init_controls(struct ov01a10 *ov01a10)
|
|||
V4L2_CID_LINK_FREQ,
|
||||
ov01a10->link_freq_index, 0,
|
||||
link_freq_menu_items);
|
||||
if (ov01a10->link_freq)
|
||||
ov01a10->link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY;
|
||||
|
||||
ov01a10->pixel_rate = v4l2_ctrl_new_std(ctrl_hdlr, &ov01a10_ctrl_ops,
|
||||
V4L2_CID_PIXEL_RATE, 0,
|
||||
|
|
@ -478,8 +476,6 @@ static int ov01a10_init_controls(struct ov01a10 *ov01a10)
|
|||
ov01a10->hblank = v4l2_ctrl_new_std(ctrl_hdlr, &ov01a10_ctrl_ops,
|
||||
V4L2_CID_HBLANK, h_blank, h_blank,
|
||||
1, h_blank);
|
||||
if (ov01a10->hblank)
|
||||
ov01a10->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY;
|
||||
|
||||
v4l2_ctrl_new_std(ctrl_hdlr, &ov01a10_ctrl_ops, V4L2_CID_ANALOGUE_GAIN,
|
||||
OV01A10_ANAL_GAIN_MIN, OV01A10_ANAL_GAIN_MAX,
|
||||
|
|
@ -516,6 +512,9 @@ static int ov01a10_init_controls(struct ov01a10 *ov01a10)
|
|||
goto fail;
|
||||
}
|
||||
|
||||
ov01a10->link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY;
|
||||
ov01a10->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY;
|
||||
|
||||
ov01a10->sd.ctrl_handler = ctrl_hdlr;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user