aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@csr.com>2008-10-20 11:07:19 -0400
committerDavid Vrabel <david.vrabel@csr.com>2008-10-20 11:07:19 -0400
commit61e0e79ee3c609eb34edf2fe023708cba6a79b1f (patch)
tree663deacffd4071120dc9badb70428fe5f124c7b9 /Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
parentc15895ef30c2c03e99802951787183039a349d32 (diff)
parent0cfd81031a26717fe14380d18275f8e217571615 (diff)
Merge branch 'master' into for-upstream
Conflicts: Documentation/ABI/testing/sysfs-bus-usb drivers/Makefile
Diffstat (limited to 'Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl')
-rw-r--r--Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl65
1 files changed, 39 insertions, 26 deletions
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
index e13c4e67029..87a7c07ab65 100644
--- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
@@ -5073,8 +5073,7 @@ struct _snd_pcm_runtime {
5073 with <constant>SNDRV_DMA_TYPE_CONTINUOUS</constant> type and the 5073 with <constant>SNDRV_DMA_TYPE_CONTINUOUS</constant> type and the
5074 <function>snd_dma_continuous_data(GFP_KERNEL)</function> device pointer, 5074 <function>snd_dma_continuous_data(GFP_KERNEL)</function> device pointer,
5075 where <constant>GFP_KERNEL</constant> is the kernel allocation flag to 5075 where <constant>GFP_KERNEL</constant> is the kernel allocation flag to
5076 use. For the SBUS, <constant>SNDRV_DMA_TYPE_SBUS</constant> and 5076 use.
5077 <function>snd_dma_sbus_data(sbus_dev)</function> are used instead.
5078 For the PCI scatter-gather buffers, use 5077 For the PCI scatter-gather buffers, use
5079 <constant>SNDRV_DMA_TYPE_DEV_SG</constant> with 5078 <constant>SNDRV_DMA_TYPE_DEV_SG</constant> with
5080 <function>snd_dma_pci_data(pci)</function> 5079 <function>snd_dma_pci_data(pci)</function>
@@ -6135,44 +6134,58 @@ struct _snd_pcm_runtime {
6135 </para> 6134 </para>
6136 </section> 6135 </section>
6137 6136
6138 <section id="useful-functions-snd-assert"> 6137 <section id="useful-functions-snd-bug">
6139 <title><function>snd_assert()</function></title> 6138 <title><function>snd_BUG()</function></title>
6140 <para> 6139 <para>
6141 <function>snd_assert()</function> macro is similar with the 6140 It shows the <computeroutput>BUG?</computeroutput> message and
6142 normal <function>assert()</function> macro. For example, 6141 stack trace as well as <function>snd_BUG_ON</function> at the point.
6142 It's useful to show that a fatal error happens there.
6143 </para>
6144 <para>
6145 When no debug flag is set, this macro is ignored.
6146 </para>
6147 </section>
6148
6149 <section id="useful-functions-snd-bug-on">
6150 <title><function>snd_BUG_ON()</function></title>
6151 <para>
6152 <function>snd_BUG_ON()</function> macro is similar with
6153 <function>WARN_ON()</function> macro. For example,
6143 6154
6144 <informalexample> 6155 <informalexample>
6145 <programlisting> 6156 <programlisting>
6146<![CDATA[ 6157<![CDATA[
6147 snd_assert(pointer != NULL, return -EINVAL); 6158 snd_BUG_ON(!pointer);
6148]]> 6159]]>
6149 </programlisting> 6160 </programlisting>
6150 </informalexample> 6161 </informalexample>
6151 </para>
6152 6162
6153 <para> 6163 or it can be used as the condition,
6154 The first argument is the expression to evaluate, and the 6164 <informalexample>
6155 second argument is the action if it fails. When 6165 <programlisting>
6156 <constant>CONFIG_SND_DEBUG</constant>, is set, it will show an 6166<![CDATA[
6157 error message such as <computeroutput>BUG? (xxx)</computeroutput> 6167 if (snd_BUG_ON(non_zero_is_bug))
6158 together with stack trace. 6168 return -EINVAL;
6159 </para> 6169]]>
6160 <para> 6170 </programlisting>
6161 When no debug flag is set, this macro is ignored. 6171 </informalexample>
6162 </para>
6163 </section>
6164 6172
6165 <section id="useful-functions-snd-bug">
6166 <title><function>snd_BUG()</function></title>
6167 <para>
6168 It shows the <computeroutput>BUG?</computeroutput> message and
6169 stack trace as well as <function>snd_assert</function> at the point.
6170 It's useful to show that a fatal error happens there.
6171 </para> 6173 </para>
6174
6172 <para> 6175 <para>
6173 When no debug flag is set, this macro is ignored. 6176 The macro takes an conditional expression to evaluate.
6177 When <constant>CONFIG_SND_DEBUG</constant>, is set, the
6178 expression is actually evaluated. If it's non-zero, it shows
6179 the warning message such as
6180 <computeroutput>BUG? (xxx)</computeroutput>
6181 normally followed by stack trace. It returns the evaluated
6182 value.
6183 When no <constant>CONFIG_SND_DEBUG</constant> is set, this
6184 macro always returns zero.
6174 </para> 6185 </para>
6186
6175 </section> 6187 </section>
6188
6176 </chapter> 6189 </chapter>
6177 6190
6178 6191