DEVICE_DETACH(9)

DEVICE_DETACH9

Detach a device

Usage

#include <sys/param.h>

#include <sys/bus.h>

int

DEVICE_DETACH(device_t dev);

Overview

Detach a device. This can be called if the user is replacing the driver software or if a device is about to be physically removed from the system (e.g. for pccard(4) devices).

The method should deallocate any system resources allocated during the DEVICE_ATTACH(9) method and reset the hardware to a sane state (i.e., disable interrupts etc.)

Return values

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

Authors

This manual page was written by Doug Rabson.

From freebsd-manpages 6.0-5 in Debian 4.0 (Etch). Parsed by carta from the page's mdoc source.