1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>v4l2_ctrl_handler_init_class</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="mediadev.html#id-1.8.2" title="Video2Linux devices"><link rel="prev" href="API-struct-v4l2-ctrl-config.html" title="struct v4l2_ctrl_config"><link rel="next" href="API-v4l2-ctrl-handler-free.html" title="v4l2_ctrl_handler_free"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">v4l2_ctrl_handler_init_class</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-struct-v4l2-ctrl-config.html">Prev</a> </td><th width="60%" align="center">Video2Linux devices</th><td width="20%" align="right"> <a accesskey="n" href="API-v4l2-ctrl-handler-free.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-v4l2-ctrl-handler-init-class"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>v4l2_ctrl_handler_init_class — 
2     Initialize the control handler.
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">v4l2_ctrl_handler_init_class </b>(</code></td><td><a class="link" href="API-struct-v4l2-ctrl-handler.html" title="struct v4l2_ctrl_handler">struct v4l2_ctrl_handler</a> * <var class="pdparam">hdl</var>, </td></tr><tr><td> </td><td>unsigned <var class="pdparam">nr_of_controls_hint</var>, </td></tr><tr><td> </td><td>struct lock_class_key * <var class="pdparam">key</var>, </td></tr><tr><td> </td><td>const char * <var class="pdparam">name</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="id-1.8.2.20.5"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>hdl</code></em></span></dt><dd><p>
4     The control handler.
5    </p></dd><dt><span class="term"><em class="parameter"><code>nr_of_controls_hint</code></em></span></dt><dd><p>
6     A hint of how many controls this handler is
7     expected to refer to. This is the total number, so including
8     any inherited controls. It doesn't have to be precise, but if
9     it is way off, then you either waste memory (too many buckets
10     are allocated) or the control lookup becomes slower (not enough
11     buckets are allocated, so there are more slow list lookups).
12     It will always work, though.
13    </p></dd><dt><span class="term"><em class="parameter"><code>key</code></em></span></dt><dd><p>
14     Used by the lock validator if CONFIG_LOCKDEP is set.
15    </p></dd><dt><span class="term"><em class="parameter"><code>name</code></em></span></dt><dd><p>
16     Used by the lock validator if CONFIG_LOCKDEP is set.
17    </p></dd></dl></div></div><div class="refsect1"><a name="id-1.8.2.20.6"></a><h2>Description</h2><p>
18   Returns an error if the buckets could not be allocated. This error will
19   also be stored in <em class="parameter"><code>hdl</code></em>-&gt;error.
20   </p><p>
21
22   Never use this call directly, always use the v4l2_ctrl_handler_init
23   macro that hides the <em class="parameter"><code>key</code></em> and <em class="parameter"><code>name</code></em> arguments.
24</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-struct-v4l2-ctrl-config.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="mediadev.html#id-1.8.2">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-v4l2-ctrl-handler-free.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">struct v4l2_ctrl_config</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">v4l2_ctrl_handler_free</span></td></tr></table></div></body></html>
25