1DEVICE_REGISTER(9)       Device drivers infrastructure      DEVICE_REGISTER(9)
2
3
4

NAME

6       device_register - register a device with the system.
7

SYNOPSIS

9       int device_register(struct device * dev);
10

ARGUMENTS

12       dev
13           pointer to the device structure
14

DESCRIPTION

16       This happens in two clean steps - initialize the device and add it to
17       the system. The two steps can be called separately, but this is the
18       easiest and most common. I.e. you should only call the two helpers
19       separately if have a clearly defined need to use and refcount the
20       device before it is added to the hierarchy.
21
22       For more information, see the kerneldoc for device_initialize and
23       device_add.
24

NOTE

26       _Never_ directly free dev after calling this function, even if it
27       returned an error! Always use put_device to give up the reference
28       initialized in this function instead.
29
31Kernel Hackers Manual 3.10         June 2019                DEVICE_REGISTER(9)
Impressum