device_register9
Register a device with the system.
Usage
int device_register(struct device * dev);
Arguments
dev
pointer to the device structure
Overview
This happens in two clean steps - initialize the device and add it to the system. The two steps can be called separately, but this is the easiest and most common. I.e. you should only call the two helpers separately if have a clearly defined need to use and refcount the device before it is added to the hierarchy.
For more information, see the kerneldoc for device_initialize and device_add.
Note
_Never_ directly free dev after calling this function, even if it returned an error! Always use put_device to give up the reference initialized in this function instead.
Releases
5 releases since Debian 4.0 (Etch); the text changed 4 times.