class_device_create
时间:2009-04-02 来源:hsq863
这个函数好像是动态创建设备文件的,但是我的cramfs文件系统,还不可写,怎么处理?
Name
class_device_create — creates a class device and registers it with sysfs
Synopsis
struct class_device * class_device_create ( | struct class * | cls, |
struct class_device * | parent, | |
dev_t | devt, | |
struct device * | device, | |
const char * | fmt, | |
...); |
Arguments
clspointer to the struct class that this device should be registered to.
parentpointer to the parent struct class_device of this new device, if any.
devtthe dev_t for the char device to be added.
devicea pointer to a struct device that is assiociated with this class device.
fmtstring for the class device's name
...variable arguments
Description
This function can be used by char device classes. A struct class_device will be created in sysfs, registered to the specified class. A “dev” file will be created, showing the dev_t for the device, if the dev_t is not 0,0. If a pointer to a parent struct class_device is passed in, the newly created struct class_device will be a child of that device in sysfs. The pointer to the struct class_device will be returned from the call. Any further sysfs files that might be required can be created using this pointer.
Note
the struct class passed to this function must have previously been created with a call to class_create.