函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\char_dev.c Create Date:2022-07-29 10:32:41
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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

函数原型:int cdev_add(struct cdev *p, dev_t dev, unsigned count)

返回类型:int

参数:

类型参数名称
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  如果error则返回:error
491  增加引用计数对象
493  返回:0
调用者
名称描述
__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