man.bsd.lv manual page server

Manual Page Search Parameters

BUS_RELEASE_RESOURCE(9) Kernel Developer's Manual BUS_RELEASE_RESOURCE(9)

bus_release_resourcerelease resources on a bus

#include <sys/param.h>
#include <sys/bus.h>


#include <machine/bus.h>
#include <sys/rman.h>
#include <machine/resource.h>

int
bus_release_resource(device_t dev, int type, int rid, struct resource *r);

Free a resource allocated by bus_alloc_resource(9). The resource must not be in use on release, i.e., call an appropriate function before (e.g. bus_teardown_intr(9) for IRQs).

EINVAL is returned, if the device dev has no parent, 0 otherwise. The kernel will panic, if it cannot release the resource.

	/* deactivate IRQ */
	bus_teardown_intr(dev, foosoftc->irqres, foosoftc->irqid);

	/* release IRQ resource */
	bus_release_resource(dev, SYS_RES_IRQ, foosoftc->irqid,
		foosoftc->irqres);

	/* release I/O port resource */
	bus_release_resource(dev, SYS_RES_IOPORT, foosoftc->portid,
		foosoftc->portres);

bus_alloc_resource(9), device(9), driver(9)

This manual page was written by Alexander Langer <alex@big.endian.de>.

May 18, 2000 FreeBSD-12.0