/*注册设备*/ static int ds18b20_init(void)
{
int result;
dev = MKDEV(ds18b20_major,0);
if(ds18b20_major)
result = register_chrdev_region(dev,1,"ds18b20");
else{
result = alloc_chrdev_region(&dev,0,1,"ds18b20");
ds18b20_major=MAJOR(dev);
}
if( result < 0 ){
printk(KERN_WARNING"ds18b20:unable to get major %d\n",ds18b20_major);
return result;
}
if(ds18b20_major == 0 )
ds18b20_major = result;