Next: , Previous: Device Open, Up: Device Interface


10.3 Device Close

— Function: kern_return_t device_close (device_t device)

The function device_close decrements the open count of the device by one. If the open count drops to zero, the close handler for the device is called. The device to close is specified by its port device.

The function returns D_SUCCESS if the device was successfully closed and D_NO_SUCH_DEVICE if device does not denote a device port.