Name

device_add — add device to device hierarchy.

Synopsis

int device_add (struct device * dev);
 

Arguments

dev

device.

Description

This is part 2 of device_register, though may be called separately _iff_ device_initialize has been called separately.

This adds dev to the kobject hierarchy via kobject_add, adds it to the global and sibling lists for the device, then adds it to the other relevant subsystems of the driver model.

NOTE

_Never_ directly free dev after calling this function, even if it returned an error! Always use put_device to give up your reference instead.