1DEVICE_INITIALIZE(9) Device drivers infrastructure DEVICE_INITIALIZE(9)
2
3
4
6 device_initialize - init device structure.
7
9 void device_initialize(struct device * dev);
10
12 dev
13 device.
14
16 This prepares the device for use by other layers by initializing its
17 fields. It is the first half of device_register, if called by that
18 function, though it can also be called separately, so one may use dev's
19 fields. In particular, get_device/put_device may be used for reference
20 counting of dev after calling this function.
21
22 All fields in dev must be initialized by the caller to 0, except for
23 those explicitly set to some other value. The simplest approach is to
24 use kzalloc to allocate the structure containing dev.
25
27 Use put_device to give up your reference instead of freeing dev
28 directly once you have called this function.
29
31Kernel Hackers Manual 3.10 June 2019 DEVICE_INITIALIZE(9)