1__REGISTER_CHRDEV(9) Char devices __REGISTER_CHRDEV(9)
2
3
4
6 __register_chrdev - create and register a cdev occupying a range of
7 minors
8
10 int __register_chrdev(unsigned int major, unsigned int baseminor,
11 unsigned int count, const char * name,
12 const struct file_operations * fops);
13
15 major
16 major device number or 0 for dynamic allocation
17
18 baseminor
19 first of the requested range of minor numbers
20
21 count
22 the number of minor numbers required
23
24 name
25 name of this range of devices
26
27 fops
28 file operations associated with this devices
29
31 If major == 0 this functions will dynamically allocate a major and
32 return its number.
33
34 If major > 0 this function will attempt to reserve a device with the
35 given major number and will return zero on success.
36
37 Returns a -ve errno on failure.
38
39 The name of this device has nothing to do with the name of the device
40 in /dev. It only helps to keep track of the different owners of
41 devices. If your module name has only one type of devices it's ok to
42 use e.g. the name of the module here.
43
45Kernel Hackers Manual 2.6. November 2011 __REGISTER_CHRDEV(9)