Staging: comedi: Remove comedi_cmd typedef
[linux-2.6-block.git] / drivers / staging / comedi / comedidev.h
index 4fba9e7d437ea008879ef90059105a13f4d0453a..8e60fdb33964a6ccf599de7930527c3659b23398 100644 (file)
 #define COMEDI_NUM_BOARD_MINORS 0x30
 #define COMEDI_FIRST_SUBDEVICE_MINOR COMEDI_NUM_BOARD_MINORS
 
-typedef struct comedi_async_struct comedi_async;
-typedef struct comedi_driver_struct comedi_driver;
-typedef struct comedi_lrange_struct comedi_lrange;
-
-typedef struct device device_create_result_type;
-
 #define COMEDI_DEVICE_CREATE(cs, parent, devt, drvdata, device, fmt...) \
        device_create(cs, ((parent) ? (parent) : (device)), devt, drvdata, fmt)
 
@@ -139,7 +133,7 @@ struct comedi_subdevice {
 
        void *private;
 
-       comedi_async *async;
+       struct comedi_async *async;
 
        void *lock;
        void *busy;
@@ -156,8 +150,8 @@ struct comedi_subdevice {
 
        unsigned int settling_time_0;
 
-       const comedi_lrange *range_table;
-       const comedi_lrange *const *range_table_list;
+       const struct comedi_lrange *range_table;
+       const struct comedi_lrange *const *range_table_list;
 
        unsigned int *chanlist; /* driver-owned chanlist (not used) */
 
@@ -171,7 +165,7 @@ struct comedi_subdevice {
                unsigned int *);
 
        int (*do_cmd) (struct comedi_device *, struct comedi_subdevice *);
-       int (*do_cmdtest) (struct comedi_device *, struct comedi_subdevice *, comedi_cmd *);
+       int (*do_cmdtest) (struct comedi_device *, struct comedi_subdevice *, struct comedi_cmd *);
        int (*poll) (struct comedi_device *, struct comedi_subdevice *);
        int (*cancel) (struct comedi_device *, struct comedi_subdevice *);
        /* int (*do_lock)(struct comedi_device *,struct comedi_subdevice *); */
@@ -187,7 +181,7 @@ struct comedi_subdevice {
 
        unsigned int state;
 
-       device_create_result_type *class_dev;
+       struct device *class_dev;
        int minor;
 };
 
@@ -196,7 +190,7 @@ struct comedi_buf_page {
        dma_addr_t dma_addr;
 };
 
-struct comedi_async_struct {
+struct comedi_async {
        struct comedi_subdevice *subdevice;
 
        void *prealloc_buf;     /* pre-allocated buffer */
@@ -227,7 +221,7 @@ struct comedi_async_struct {
 
        unsigned int events;    /* events that have occurred */
 
-       comedi_cmd cmd;
+       struct comedi_cmd cmd;
 
        wait_queue_head_t wait_head;
 
@@ -240,8 +234,8 @@ struct comedi_async_struct {
                        unsigned int x);
 };
 
-struct comedi_driver_struct {
-       struct comedi_driver_struct *next;
+struct comedi_driver {
+       struct comedi_driver *next;
 
        const char *driver_name;
        struct module *module;
@@ -257,10 +251,10 @@ struct comedi_driver_struct {
 
 struct comedi_device {
        int use_count;
-       comedi_driver *driver;
+       struct comedi_driver *driver;
        void *private;
 
-       device_create_result_type *class_dev;
+       struct device *class_dev;
        int minor;
        /* hw_dev is passed to dma_alloc_coherent when allocating async buffers
         * for subdevices that have async_dma_dir set to something other than
@@ -344,8 +338,8 @@ static inline struct comedi_subdevice *comedi_get_write_subdevice(
 
 void comedi_device_detach(struct comedi_device *dev);
 int comedi_device_attach(struct comedi_device *dev, comedi_devconfig *it);
-int comedi_driver_register(comedi_driver *);
-int comedi_driver_unregister(comedi_driver *);
+int comedi_driver_register(struct comedi_driver *);
+int comedi_driver_unregister(struct comedi_driver *);
 
 void init_polling(void);
 void cleanup_polling(void);
@@ -398,12 +392,12 @@ int insn_inval(struct comedi_device *dev, struct comedi_subdevice *s,
 #define BIP_RANGE(a)           {-(a)*1e6, (a)*1e6, 0}
 #define UNI_RANGE(a)           {0, (a)*1e6, 0}
 
-extern const comedi_lrange range_bipolar10;
-extern const comedi_lrange range_bipolar5;
-extern const comedi_lrange range_bipolar2_5;
-extern const comedi_lrange range_unipolar10;
-extern const comedi_lrange range_unipolar5;
-extern const comedi_lrange range_unknown;
+extern const struct comedi_lrange range_bipolar10;
+extern const struct comedi_lrange range_bipolar5;
+extern const struct comedi_lrange range_bipolar2_5;
+extern const struct comedi_lrange range_unipolar10;
+extern const struct comedi_lrange range_unipolar5;
+extern const struct comedi_lrange range_unknown;
 
 #define range_digital          range_unipolar5
 
@@ -413,7 +407,7 @@ extern const comedi_lrange range_unknown;
 #define GCC_ZERO_LENGTH_ARRAY 0
 #endif
 
-struct comedi_lrange_struct {
+struct comedi_lrange {
        int length;
        comedi_krange range[GCC_ZERO_LENGTH_ARRAY];
 };
@@ -469,31 +463,31 @@ static inline void comedi_set_hw_dev(struct comedi_device *dev, struct device *h
        }
 }
 
-int comedi_buf_put(comedi_async *async, short x);
-int comedi_buf_get(comedi_async *async, short *x);
+int comedi_buf_put(struct comedi_async *async, short x);
+int comedi_buf_get(struct comedi_async *async, short *x);
 
-unsigned int comedi_buf_write_n_available(comedi_async *async);
-unsigned int comedi_buf_write_alloc(comedi_async *async, unsigned int nbytes);
-unsigned int comedi_buf_write_alloc_strict(comedi_async *async,
+unsigned int comedi_buf_write_n_available(struct comedi_async *async);
+unsigned int comedi_buf_write_alloc(struct comedi_async *async, unsigned int nbytes);
+unsigned int comedi_buf_write_alloc_strict(struct comedi_async *async,
        unsigned int nbytes);
-unsigned comedi_buf_write_free(comedi_async *async, unsigned int nbytes);
-unsigned comedi_buf_read_alloc(comedi_async *async, unsigned nbytes);
-unsigned comedi_buf_read_free(comedi_async *async, unsigned int nbytes);
-unsigned int comedi_buf_read_n_available(comedi_async *async);
-void comedi_buf_memcpy_to(comedi_async *async, unsigned int offset,
+unsigned comedi_buf_write_free(struct comedi_async *async, unsigned int nbytes);
+unsigned comedi_buf_read_alloc(struct comedi_async *async, unsigned nbytes);
+unsigned comedi_buf_read_free(struct comedi_async *async, unsigned int nbytes);
+unsigned int comedi_buf_read_n_available(struct comedi_async *async);
+void comedi_buf_memcpy_to(struct comedi_async *async, unsigned int offset,
        const void *source, unsigned int num_bytes);
-void comedi_buf_memcpy_from(comedi_async *async, unsigned int offset,
+void comedi_buf_memcpy_from(struct comedi_async *async, unsigned int offset,
        void *destination, unsigned int num_bytes);
-static inline unsigned comedi_buf_write_n_allocated(comedi_async *async)
+static inline unsigned comedi_buf_write_n_allocated(struct comedi_async *async)
 {
        return async->buf_write_alloc_count - async->buf_write_count;
 }
-static inline unsigned comedi_buf_read_n_allocated(comedi_async *async)
+static inline unsigned comedi_buf_read_n_allocated(struct comedi_async *async)
 {
        return async->buf_read_alloc_count - async->buf_read_count;
 }
 
-void comedi_reset_async_buf(comedi_async *async);
+void comedi_reset_async_buf(struct comedi_async *async);
 
 static inline void *comedi_aux_data(int options[], int n)
 {