---
name: "bus_deactivate_resource"
section: "9"
platform: "linux"
package: "freebsd-manpages"
version: "6.0-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/bus_deactivate_resource"
---

# bus\_deactivate\_resource(9)

activate or deactivate a resource

## NAME

**bus\_activate\_resource**, **bus\_deactivate\_resource** – activate or deactivate a resource

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<sys/bus.h\>**

**#include \<machine/bus.h\>**

**#include \<sys/rman.h\>**

**#include \<machine/resource.h\>**

*int*\

**bus\_activate\_resource**(*device\_t dev*, *int type*, *int rid*, *struct resource \*r*);

*int*\

**bus\_deactivate\_resource**(*device\_t dev*, *int type*, *int rid*, *struct resource \*r*);

## DESCRIPTION

These functions activate or deactivate a previously allocated resource. In general, resources must be activated before they can be accessed by the driver so that the bus driver can map the resource into the devices space.

The arguments are as follows:

- *dev*

  The device that requests ownership of the resource. Before allocation, the resource is owned by the parent bus.

- *type*

  The type of resource you want to allocate. It is one of:

  - SYS\_RES\_IRQ

    for IRQs

  - SYS\_RES\_DRQ

    for ISA DMA lines

  - SYS\_RES\_IOPORT

    for I/O ports

  - SYS\_RES\_MEMORY

    for I/O memory

- *rid*

  A pointer to a bus specific handle that identifies the resource being allocated.

- *r*

  A pointer to the *struct resource* returned by [bus\_alloc\_resource(9)](/bus_alloc_resource/9.md).

## RETURN VALUES

Zero is returned on success, otherwise an error is returned.

## SEE ALSO

[bus\_alloc\_resource(9)](/bus_alloc_resource/9.md), [device(9)](/device/9.md), [driver(9)](/driver/9.md)

## AUTHORS

This manual page was written by Warner Losh ⟨imp@FreeBSD.org⟩.
