xref: /xnu-10002.41.9/osfmk/man/device_close.html (revision 699cd48037512bf4380799317ca44ca453c82f57)
1<h2>device_close</h2>
2<hr>
3<p>
4<strong>Function</strong> - De-establish a connection to a device.
5<h3>SYNOPSIS</h3>
6<pre>
7<strong>#include&lt device/device.h&gt</strong>
8
9<strong>kern_return_t	device_close</strong>
10		<strong>(mach_port_t</strong>	<var>device</var><strong>);</strong>
11</pre>
12<h3>PARAMETERS</h3>
13<dl>
14<p>
15<dt> <var>device</var>
16<dd>
17[in device send right]
18A device port to the device to be closed.
19</dl>
20<h3>DESCRIPTION</h3>
21<p>
22The <strong>device_close</strong> function destroys the associated device
23port.  The open count
24for the named device is decremented.  If this count reaches zero, the close
25operation of the device driver is invoked, closing the device.
26<h3>NOTES</h3>
27<p>
28<strong>device_close</strong> will destroy any mapped device windows
29obtained through this
30device port.
31<h3>RETURN VALUES</h3>
32<dl>
33<p>
34<dt> <strong>D_NO_SUCH_DEVICE</strong>
35<dd>
36No device with that name, or the device is not operational.
37</dl>
38<h3>RELATED INFORMATION</h3>
39<p>
40Functions:
41<a href="device_open.html"><strong>device_open</strong></a>.
42