Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:dev_add() - add a char device to the system*@p: the cdev structure for the device*@dev: the first device number for which this device is responsible*@count: the number of consecutive minor numbers corresponding to this* device* cdev_add() adds the device

Proto:int cdev_add(struct cdev *p, dev_t dev, unsigned count)

Type:int

Parameter:

TypeParameterName
struct cdev *p
dev_tdev
unsignedcount
483  dev = dev
484  count = count
486  error = kobj_map(cdev_map, dev, count, NULL, exact_match, exact_lock, p)
488  If error Then Return error
491  kobject_get() - Increment refcount for object.*@kobj: object.
493  Return 0
Caller
NameDescribe
__register_chrdev__register_chrdev() - create and register a cdev occupying a range of minors*@major: major device number or 0 for dynamic allocation*@baseminor: first of the requested range of minor numbers*@count: the number of minor numbers required*@name: name of this
cdev_device_adddev_device_add() - add a char device and it's corresponding* struct device, linkink*@dev: the device structure*@cdev: the cdev structure* cdev_device_add() adds the char device represented by @cdev to the system,* just as cdev_add does