Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] v4l2-ctrls: remove unclaimed v4l2_ctrl_add_ctrl() interface

v4l2_ctrl_add_ctrl() interface has no users since its introduction in
commit 0996517cf8ea ("V4L/DVB: v4l2: Add new control handling framework")
and its functionality is covered by v4l2_ctrl_new() and derivative
interfaces, so it is safe to remove the interface from the kernel.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Vladimir Zapolskiy and committed by
Mauro Carvalho Chehab
8ddc2dd0 df0e5775

-29
-1
Documentation/video4linux/v4l2-controls.txt
··· 647 647 volume = v4l2_ctrl_new_std(&video_ctrl_handler, &ops, V4L2_CID_AUDIO_VOLUME, ...); 648 648 v4l2_ctrl_new_std(&video_ctrl_handler, &ops, V4L2_CID_BRIGHTNESS, ...); 649 649 v4l2_ctrl_new_std(&video_ctrl_handler, &ops, V4L2_CID_CONTRAST, ...); 650 - v4l2_ctrl_add_ctrl(&radio_ctrl_handler, volume); 651 650 652 651 What you should not do is make two identical controls for two handlers. 653 652 For example:
-16
drivers/media/v4l2-core/v4l2-ctrls.c
··· 2227 2227 } 2228 2228 EXPORT_SYMBOL(v4l2_ctrl_new_int_menu); 2229 2229 2230 - /* Add a control from another handler to this handler */ 2231 - struct v4l2_ctrl *v4l2_ctrl_add_ctrl(struct v4l2_ctrl_handler *hdl, 2232 - struct v4l2_ctrl *ctrl) 2233 - { 2234 - if (hdl == NULL || hdl->error) 2235 - return NULL; 2236 - if (ctrl == NULL) { 2237 - handler_set_err(hdl, -EINVAL); 2238 - return NULL; 2239 - } 2240 - if (ctrl->handler == hdl) 2241 - return ctrl; 2242 - return handler_new_ref(hdl, ctrl) ? NULL : ctrl; 2243 - } 2244 - EXPORT_SYMBOL(v4l2_ctrl_add_ctrl); 2245 - 2246 2230 /* Add the controls from another handler to our own. */ 2247 2231 int v4l2_ctrl_add_handler(struct v4l2_ctrl_handler *hdl, 2248 2232 struct v4l2_ctrl_handler *add,
-12
include/media/v4l2-ctrls.h
··· 535 535 u32 id, u8 max, u8 def, const s64 *qmenu_int); 536 536 537 537 /** 538 - * v4l2_ctrl_add_ctrl() - Add a control from another handler to this handler. 539 - * @hdl: The control handler. 540 - * @ctrl: The control to add. 541 - * 542 - * It will return NULL if it was unable to add the control reference. 543 - * If the control already belonged to the handler, then it will do 544 - * nothing and just return @ctrl. 545 - */ 546 - struct v4l2_ctrl *v4l2_ctrl_add_ctrl(struct v4l2_ctrl_handler *hdl, 547 - struct v4l2_ctrl *ctrl); 548 - 549 - /** 550 538 * v4l2_ctrl_add_handler() - Add all controls from handler @add to 551 539 * handler @hdl. 552 540 * @hdl: The control handler.