if(dev->attached && dev->driver->module){
__MOD_INC_USE_COUNT(dev->driver->module);
}
+
+ if(dev->attached && dev->use_count==0 && dev->open){
+ dev->open(dev);
+ }
+
dev->use_count++;
return 0;
}
}
+ if(dev->attached && dev->use_count==1 && dev->close){
+ dev->close(dev);
+ }
+
MOD_DEC_USE_COUNT;
if(dev->attached && dev->driver->module){
__MOD_DEC_USE_COUNT(dev->driver->module);
wait_queue_head_t write_wait;
struct fasync_struct *async_queue;
+
+ void (*open)(comedi_device *dev);
+ void (*close)(comedi_device *dev);
};