注册:
register_chrdev_region(dev_t first,unsigned int count,char *name)
first :要分配的设备编号范围的初始值(次设备号常设为0);
count :连续编号范围.
Name :编号相关联的设备名称. (/proc/devices);
int alloc_chrdev_region(dev_t *dev,unsigned int firstminor,unsigned int count,char *name);
*dev :存放返回的设备号
firstminor :第一个次设备号的号数,常为0;
int register_chrdev(unsigned int major, const char *name, const struct file_operations *fops)
major :要注册的设备号, 若为0则自动分配一个
name :设备名
*fops :以后再聊