提交 ad298055 编写于 作者: F Frank Schaefer 提交者: Mauro Carvalho Chehab

[media] em28xx-video: simplify usage of the pointer to struct...

[media] em28xx-video: simplify usage of the pointer to struct v4l2_ctrl_handler in em28xx_v4l2_init()

The local var hdl is already pointing to &dev->ctrl_handler.
Use it, instead of dereferencing it all the time.

Code cleanup. No functional changes.
Signed-off-by: NFrank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
上级 6743033e
无相关合并请求
...@@ -2399,35 +2399,35 @@ static int em28xx_v4l2_init(struct em28xx *dev) ...@@ -2399,35 +2399,35 @@ static int em28xx_v4l2_init(struct em28xx *dev)
/* Add image controls */ /* Add image controls */
/* NOTE: at this point, the subdevices are already registered, so bridge /* NOTE: at this point, the subdevices are already registered, so bridge
* controls are only added/enabled when no subdevice provides them */ * controls are only added/enabled when no subdevice provides them */
if (NULL == v4l2_ctrl_find(&dev->ctrl_handler, V4L2_CID_CONTRAST)) if (NULL == v4l2_ctrl_find(hdl, V4L2_CID_CONTRAST))
v4l2_ctrl_new_std(&dev->ctrl_handler, &em28xx_ctrl_ops, v4l2_ctrl_new_std(hdl, &em28xx_ctrl_ops,
V4L2_CID_CONTRAST, V4L2_CID_CONTRAST,
0, 0x1f, 1, CONTRAST_DEFAULT); 0, 0x1f, 1, CONTRAST_DEFAULT);
if (NULL == v4l2_ctrl_find(&dev->ctrl_handler, V4L2_CID_BRIGHTNESS)) if (NULL == v4l2_ctrl_find(hdl, V4L2_CID_BRIGHTNESS))
v4l2_ctrl_new_std(&dev->ctrl_handler, &em28xx_ctrl_ops, v4l2_ctrl_new_std(hdl, &em28xx_ctrl_ops,
V4L2_CID_BRIGHTNESS, V4L2_CID_BRIGHTNESS,
-0x80, 0x7f, 1, BRIGHTNESS_DEFAULT); -0x80, 0x7f, 1, BRIGHTNESS_DEFAULT);
if (NULL == v4l2_ctrl_find(&dev->ctrl_handler, V4L2_CID_SATURATION)) if (NULL == v4l2_ctrl_find(hdl, V4L2_CID_SATURATION))
v4l2_ctrl_new_std(&dev->ctrl_handler, &em28xx_ctrl_ops, v4l2_ctrl_new_std(hdl, &em28xx_ctrl_ops,
V4L2_CID_SATURATION, V4L2_CID_SATURATION,
0, 0x1f, 1, SATURATION_DEFAULT); 0, 0x1f, 1, SATURATION_DEFAULT);
if (NULL == v4l2_ctrl_find(&dev->ctrl_handler, V4L2_CID_BLUE_BALANCE)) if (NULL == v4l2_ctrl_find(hdl, V4L2_CID_BLUE_BALANCE))
v4l2_ctrl_new_std(&dev->ctrl_handler, &em28xx_ctrl_ops, v4l2_ctrl_new_std(hdl, &em28xx_ctrl_ops,
V4L2_CID_BLUE_BALANCE, V4L2_CID_BLUE_BALANCE,
-0x30, 0x30, 1, BLUE_BALANCE_DEFAULT); -0x30, 0x30, 1, BLUE_BALANCE_DEFAULT);
if (NULL == v4l2_ctrl_find(&dev->ctrl_handler, V4L2_CID_RED_BALANCE)) if (NULL == v4l2_ctrl_find(hdl, V4L2_CID_RED_BALANCE))
v4l2_ctrl_new_std(&dev->ctrl_handler, &em28xx_ctrl_ops, v4l2_ctrl_new_std(hdl, &em28xx_ctrl_ops,
V4L2_CID_RED_BALANCE, V4L2_CID_RED_BALANCE,
-0x30, 0x30, 1, RED_BALANCE_DEFAULT); -0x30, 0x30, 1, RED_BALANCE_DEFAULT);
if (NULL == v4l2_ctrl_find(&dev->ctrl_handler, V4L2_CID_SHARPNESS)) if (NULL == v4l2_ctrl_find(hdl, V4L2_CID_SHARPNESS))
v4l2_ctrl_new_std(&dev->ctrl_handler, &em28xx_ctrl_ops, v4l2_ctrl_new_std(hdl, &em28xx_ctrl_ops,
V4L2_CID_SHARPNESS, V4L2_CID_SHARPNESS,
0, 0x0f, 1, SHARPNESS_DEFAULT); 0, 0x0f, 1, SHARPNESS_DEFAULT);
/* Reset image controls */ /* Reset image controls */
em28xx_colorlevels_set_default(dev); em28xx_colorlevels_set_default(dev);
v4l2_ctrl_handler_setup(&dev->ctrl_handler); v4l2_ctrl_handler_setup(hdl);
ret = dev->ctrl_handler.error; ret = hdl->error;
if (ret) if (ret)
goto unregister_dev; goto unregister_dev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部