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

NAME

6       device_create_vargs - creates a device and registers it with sysfs
7

SYNOPSIS

9       struct device * device_create_vargs(struct class * class,
10                                           struct device * parent, dev_t devt,
11                                           void * drvdata, const char * fmt,
12                                           va_list args);
13

ARGUMENTS

15       class
16           pointer to the struct class that this device should be registered
17           to
18
19       parent
20           pointer to the parent struct device of this new device, if any
21
22       devt
23           the dev_t for the char device to be added
24
25       drvdata
26           the data to be added to the device for callbacks
27
28       fmt
29           string for the device's name
30
31       args
32           va_list for the device's name
33

DESCRIPTION

35       This function can be used by char device classes. A struct device will
36       be created in sysfs, registered to the specified class.
37
38       A “dev” file will be created, showing the dev_t for the device, if the
39       dev_t is not 0,0. If a pointer to a parent struct device is passed in,
40       the newly created struct device will be a child of that device in
41       sysfs. The pointer to the struct device will be returned from the call.
42       Any further sysfs files that might be required can be created using
43       this pointer.
44
45       Returns struct device pointer on success, or ERR_PTR on error.
46

NOTE

48       the struct class passed to this function must have previously been
49       created with a call to class_create.
50
52Kernel Hackers Manual 3.10         June 2019            DEVICE_CREATE_VARGS(9)
Impressum