Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\char_dev.c Create Date:2022-07-28 20:02:45
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:gister_chrdev_region() - register a range of device numbers*@from: the first in the desired range of device numbers; must include* the major number.*@count: the number of consecutive device numbers required*@name: the name of the device or driver.

Proto:int register_chrdev_region(dev_t from, unsigned count, const char *name)

Type:int

Parameter:

TypeParameterName
dev_tfrom
unsignedcount
const char *name
203  to = from + count
206  When n < to cycle
207  next = MKDEV(MAJOR(n) + 1, 0)
208  If next > to Then next = to
210  cd = Register a single major with a specified minor range.* If major == 0 this function will dynamically allocate an unused major.* If major > 0 this function will attempt to reserve the range of minors* with given major.
212  If IS_ERR(cd) Then Go to fail
215  Return 0
216  fail :
217  to = n
218  When n < to cycle
219  next = MKDEV(MAJOR(n) + 1, 0)
220  kfree(__unregister_chrdev_region(MAJOR(n), MINOR(n), next - n))
222  Return PTR_ERR(cd)