staging: comedi: remove comedi_dev_from_minor()
[firefly-linux-kernel-4.4.55.git] / drivers / staging / comedi / comedidev.h
index 05cc8dbcd515f513f06e6ad74fdb45b2f962fb65..4e7cd1443be66e0a7cab38c940483fe63b93f2d8 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/mutex.h>
 #include <linux/spinlock_types.h>
 #include <linux/rwsem.h>
+#include <linux/kref.h>
 
 #include "comedi.h"
 
@@ -187,6 +188,7 @@ struct comedi_device {
        spinlock_t spinlock;
        struct mutex mutex;
        struct rw_semaphore attach_lock;
+       struct kref refcount;
 
        int n_subdevices;
        struct comedi_subdevice *subdevices;
@@ -233,7 +235,8 @@ enum comedi_minor_bits {
 static const unsigned COMEDI_SUBDEVICE_MINOR_SHIFT = 4;
 static const unsigned COMEDI_SUBDEVICE_MINOR_OFFSET = 1;
 
-struct comedi_device *comedi_dev_from_minor(unsigned minor);
+struct comedi_device *comedi_dev_get_from_minor(unsigned minor);
+int comedi_dev_put(struct comedi_device *dev);
 
 void init_polling(void);
 void cleanup_polling(void);