Name

v4l2_ctrl_handler_init_class — Initialize the control handler.

Synopsis

int v4l2_ctrl_handler_init_class (struct v4l2_ctrl_handler * hdl,
 unsigned nr_of_controls_hint,
 struct lock_class_key * key,
 const char * name);
 

Arguments

hdl

The control handler.

nr_of_controls_hint

A hint of how many controls this handler is expected to refer to. This is the total number, so including any inherited controls. It doesn't have to be precise, but if it is way off, then you either waste memory (too many buckets are allocated) or the control lookup becomes slower (not enough buckets are allocated, so there are more slow list lookups). It will always work, though.

key

Used by the lock validator if CONFIG_LOCKDEP is set.

name

Used by the lock validator if CONFIG_LOCKDEP is set.

Description

Returns an error if the buckets could not be allocated. This error will also be stored in hdl->error.

Never use this call directly, always use the v4l2_ctrl_handler_init macro that hides the key and name arguments.