<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi Sakari,<br>
</p>
<div class="moz-cite-prefix">On 2021/11/18 下午 07:56, Sakari Ailus
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:YZY%2FVCt8WZx%2F4dFt@paasikivi.fi.intel.com">
<pre class="moz-quote-pre" wrap="">Hi Jammy,
On Thu, Nov 18, 2021 at 03:40:23PM +0800, Jammy Huang wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">The debug log level, 0~3, is controlled by module_param, debug.
The higher the value, the more the information.
0: off
1: info
2: debug
3: register operations
Signed-off-by: Jammy Huang <a class="moz-txt-link-rfc2396E" href="mailto:jammy_huang@aspeedtech.com"><jammy_huang@aspeedtech.com></a>
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Just wondering: what's the purpose of switching to v4l2_*() functions for
printing when dev_*() equivalents already can do the same?
</pre>
</blockquote>
<pre class="moz-signature" cols="72">Indeed, most of them, such as dev_err/v4l2_err or dev_info/v4l2_info, are the same.
The reason why I want to adapt v4l2_*() is v4l2_dbg with which I can have module's
own debug level.
<span class="cm" style="box-sizing: inherit; color: slategray; font-style: italic;">/* These three macros assume that the debug level is set with a module</span>
<span class="cm" style="box-sizing: inherit; color: slategray; font-style: italic;"> parameter called 'debug'. */</span>
<span class="cp" style="box-sizing: inherit; color: rgb(85, 119, 153);">#define <a href="https://elixir.bootlin.com/linux/latest/C/ident/v4l2_dbg" style="box-sizing: inherit; background: linear-gradient(rgba(0, 0, 0, 0) 10%, rgb(244, 246, 255) 10%, rgb(244, 246, 255) 90%, rgba(0, 0, 0, 0) 90%); color: inherit; text-decoration: none; font-weight: 700; border-radius: 0.2em;">v4l2_dbg</a>(<a href="https://elixir.bootlin.com/linux/latest/C/ident/level" style="box-sizing: inherit; background: linear-gradient(rgba(0, 0, 0, 0) 10%, rgb(244, 246, 255) 10%, rgb(244, 246, 255) 90%, rgba(0, 0, 0, 0) 90%); color: inherit; text-decoration: none; font-weight: 700; border-radius: 0.2em;">level</a>, <a href="https://elixir.bootlin.com/linux/latest/C/ident/debug" style="box-sizing: inherit; background: linear-gradient(rgba(0, 0, 0, 0) 10%, rgb(244, 246, 255) 10%, rgb(244, 246, 255) 90%, rgba(0, 0, 0, 0) 90%); color: inherit; text-decoration: none; font-weight: 700; border-radius: 0.2em;">debug</a>, dev, <a href="https://elixir.bootlin.com/linux/latest/C/ident/fmt" style="box-sizing: inherit; background: linear-gradient(rgba(0, 0, 0, 0) 10%, rgb(244, 246, 255) 10%, rgb(244, 246, 255) 90%, rgba(0, 0, 0, 0) 90%); color: inherit; text-decoration: none; font-weight: 700; border-radius: 0.2em;">fmt</a>, arg...) \</span>
<span class="cp" style="box-sizing: inherit; color: rgb(85, 119, 153);"> do { \</span>
<span class="cp" style="box-sizing: inherit; color: rgb(85, 119, 153);"> if (<a href="https://elixir.bootlin.com/linux/latest/C/ident/debug" style="box-sizing: inherit; background: linear-gradient(rgba(0, 0, 0, 0) 10%, rgb(244, 246, 255) 10%, rgb(244, 246, 255) 90%, rgba(0, 0, 0, 0) 90%); color: inherit; text-decoration: none; font-weight: 700; border-radius: 0.2em;">debug</a> >= (<a href="https://elixir.bootlin.com/linux/latest/C/ident/level" style="box-sizing: inherit; background: linear-gradient(rgba(0, 0, 0, 0) 10%, rgb(244, 246, 255) 10%, rgb(244, 246, 255) 90%, rgba(0, 0, 0, 0) 90%); color: inherit; text-decoration: none; font-weight: 700; border-radius: 0.2em;">level</a>)) \</span>
<span class="cp" style="box-sizing: inherit; color: rgb(85, 119, 153);"> <a href="https://elixir.bootlin.com/linux/latest/C/ident/v4l2_printk" style="box-sizing: inherit; background: linear-gradient(rgba(0, 0, 0, 0) 10%, rgb(244, 246, 255) 10%, rgb(244, 246, 255) 90%, rgba(0, 0, 0, 0) 90%); color: inherit; text-decoration: none; font-weight: 700; border-radius: 0.2em;">v4l2_printk</a>(<a href="https://elixir.bootlin.com/linux/latest/C/ident/KERN_DEBUG" style="box-sizing: inherit; background: linear-gradient(rgba(0, 0, 0, 0) 10%, rgb(244, 246, 255) 10%, rgb(244, 246, 255) 90%, rgba(0, 0, 0, 0) 90%); color: inherit; text-decoration: none; font-weight: 700; border-radius: 0.2em;">KERN_DEBUG</a>, dev, <a href="https://elixir.bootlin.com/linux/latest/C/ident/fmt" style="box-sizing: inherit; background: linear-gradient(rgba(0, 0, 0, 0) 10%, rgb(244, 246, 255) 10%, rgb(244, 246, 255) 90%, rgba(0, 0, 0, 0) 90%); color: inherit; text-decoration: none; font-weight: 700; border-radius: 0.2em;">fmt</a> , ## arg); \</span>
<span class="cp" style="box-sizing: inherit; color: rgb(85, 119, 153);"> } while (0)</span>
--
Best Regards
Jammy</pre>
</body>
</html>