3 .\" Copyright (c) 2000 Alexander Langer
5 .\" All rights reserved.
7 .\" This program is free software.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
19 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 .Dt BUS_RELEASE_RESOURCE 9
35 .Nm bus_release_resource
36 .Nd release resources on a bus
43 .In machine/resource.h
45 .Fn bus_release_resource "device_t dev" "int type" "int rid" "struct resource *r"
47 Free a resource allocated by
48 .Xr bus_alloc_resource 9 .
49 The resource must not be in use on release, i.e., call an appropriate function
51 .Xr bus_teardown_intr 9
56 is the device that owns the resource.
59 is the type of resource that is released.
60 It must be of the same type you allocated it as before.
62 .Xr bus_alloc_resource 9
66 is the resource ID of the resource.
69 value must be the same as the one returned by
70 .Xr bus_alloc_resource 9 .
75 i.e., the resource itself,
77 .Xr bus_alloc_resource 9 .
81 is returned, if the device
86 The kernel will panic, if it cannot release the resource.
90 bus_teardown_intr(dev, foosoftc->irqres, foosoftc->irqid);
92 /* release IRQ resource */
93 bus_release_resource(dev, SYS_RES_IRQ, foosoftc->irqid,
96 /* release I/O port resource */
97 bus_release_resource(dev, SYS_RES_IOPORT, foosoftc->portid,
101 .Xr bus_alloc_resource 9 ,
105 This manual page was written by
106 .An Alexander Langer Aq alex@big.endian.de .