1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Registration and Release</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Writing an ALSA Driver"><link rel="up" href="card-management.html" title="Chapter&#160;3.&#160;Management of Cards and Components"><link rel="prev" href="card-management-chip-specific.html" title="Chip-Specific Data"><link rel="next" href="pci-resource.html" title="Chapter&#160;4.&#160;PCI Resource Management"></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">Registration and Release</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="card-management-chip-specific.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;3.&#160;Management of Cards and Components</th><td width="20%" align="right">&#160;<a accesskey="n" href="pci-resource.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="card-management-registration"></a>Registration and Release</h2></div></div></div><p>
2        After all components are assigned, register the card instance
3      by calling <code class="function">snd_card_register()</code>. Access
4      to the device files is enabled at this point. That is, before
5      <code class="function">snd_card_register()</code> is called, the
6      components are safely inaccessible from external side. If this
7      call fails, exit the probe function after releasing the card via
8      <code class="function">snd_card_free()</code>. 
9      </p><p>
10        For releasing the card instance, you can call simply
11      <code class="function">snd_card_free()</code>. As mentioned earlier, all
12      components are released automatically by this call. 
13      </p><p>
14      For a device which allows hotplugging, you can use
15      <code class="function">snd_card_free_when_closed</code>.  This one will
16      postpone the destruction until all devices are closed.
17      </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="card-management-chip-specific.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="card-management.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="pci-resource.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chip-Specific Data&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Chapter&#160;4.&#160;PCI Resource Management</td></tr></table></div></body></html>
18