Staging: comedi: Remove str_TimerDetails typedef in addi-data/addi_eeprom.c
[safe/jmp/linux-2.6] / drivers / staging / comedi / drivers / pcl818.c
index afe326e..43a9d56 100644 (file)
@@ -194,7 +194,7 @@ A word or two about DMA. Driver support DMA operations at two ways:
 
 #define MAGIC_DMA_WORD 0x5a5a
 
-static const comedi_lrange range_pcl818h_ai = { 9, {
+static const struct comedi_lrange range_pcl818h_ai = { 9, {
                        BIP_RANGE(5),
                        BIP_RANGE(2.5),
                        BIP_RANGE(1.25),
@@ -207,7 +207,7 @@ static const comedi_lrange range_pcl818h_ai = { 9, {
        }
 };
 
-static const comedi_lrange range_pcl818hg_ai = { 10, {
+static const struct comedi_lrange range_pcl818hg_ai = { 10, {
                        BIP_RANGE(5),
                        BIP_RANGE(0.5),
                        BIP_RANGE(0.05),
@@ -223,7 +223,7 @@ static const comedi_lrange range_pcl818hg_ai = { 10, {
        }
 };
 
-static const comedi_lrange range_pcl818l_l_ai = { 4, {
+static const struct comedi_lrange range_pcl818l_l_ai = { 4, {
                        BIP_RANGE(5),
                        BIP_RANGE(2.5),
                        BIP_RANGE(1.25),
@@ -231,7 +231,7 @@ static const comedi_lrange range_pcl818l_l_ai = { 4, {
        }
 };
 
-static const comedi_lrange range_pcl818l_h_ai = { 4, {
+static const struct comedi_lrange range_pcl818l_h_ai = { 4, {
                        BIP_RANGE(10),
                        BIP_RANGE(5),
                        BIP_RANGE(2.5),
@@ -239,12 +239,12 @@ static const comedi_lrange range_pcl818l_h_ai = { 4, {
        }
 };
 
-static const comedi_lrange range718_bipolar1 = { 1, {BIP_RANGE(1),} };
-static const comedi_lrange range718_bipolar0_5 = { 1, {BIP_RANGE(0.5),} };
-static const comedi_lrange range718_unipolar2 = { 1, {UNI_RANGE(2),} };
-static const comedi_lrange range718_unipolar1 = { 1, {BIP_RANGE(1),} };
+static const struct comedi_lrange range718_bipolar1 = { 1, {BIP_RANGE(1),} };
+static const struct comedi_lrange range718_bipolar0_5 = { 1, {BIP_RANGE(0.5),} };
+static const struct comedi_lrange range718_unipolar2 = { 1, {UNI_RANGE(2),} };
+static const struct comedi_lrange range718_unipolar1 = { 1, {BIP_RANGE(1),} };
 
-static int pcl818_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcl818_attach(struct comedi_device * dev, struct comedi_devconfig * it);
 static int pcl818_detach(struct comedi_device * dev);
 
 #ifdef unused
@@ -252,7 +252,8 @@ static int RTC_lock = 0;    /* RTC lock */
 static int RTC_timer_lock = 0; /* RTC int lock */
 #endif
 
-typedef struct {
+struct pcl818_board {
+
        const char *name;       // driver name
        int n_ranges;           // len of range list
        int n_aichan_se;        // num of A/D chans in single ended  mode
@@ -261,8 +262,8 @@ typedef struct {
        int n_aochan;           // num of D/A chans
        int n_dichan;           // num of DI chans
        int n_dochan;           // num of DO chans
-       const comedi_lrange *ai_range_type;     // default A/D rangelist
-       const comedi_lrange *ao_range_type;     // default D/A rangelist
+       const struct comedi_lrange *ai_range_type;      // default A/D rangelist
+       const struct comedi_lrange *ao_range_type;      // default D/A rangelist
        unsigned int io_range;  // len of IO space
        unsigned int IRQbits;   // allowed interrupts
        unsigned int DMAbits;   // allowed DMA chans
@@ -270,9 +271,10 @@ typedef struct {
        int ao_maxdata;         // maxdata for D/A
        unsigned char fifo;     // 1=board has FIFO
        int is_818;
-} boardtype;
+};
+
 
-static const boardtype boardtypes[] = {
+static const struct pcl818_board boardtypes[] = {
        {"pcl818l", 4, 16, 8, 25000, 1, 16, 16, &range_pcl818l_l_ai,
                        &range_unipolar5, PCLx1x_RANGE, 0x00fc,
                0x0a, 0xfff, 0xfff, 0, 1},
@@ -297,7 +299,7 @@ static const boardtype boardtypes[] = {
                0x0a, 0xfff, 0xfff, 0, 1 /* XXX ? */ },
 };
 
-#define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype))
+#define n_boardtypes (sizeof(boardtypes)/sizeof(struct pcl818_board))
 
 static struct comedi_driver driver_pcl818 = {
       driver_name:"pcl818",
@@ -306,12 +308,13 @@ static struct comedi_driver driver_pcl818 = {
       detach:pcl818_detach,
       board_name:&boardtypes[0].name,
       num_names:n_boardtypes,
-      offset:sizeof(boardtype),
+      offset:sizeof(struct pcl818_board),
 };
 
 COMEDI_INITCLEANUP(driver_pcl818);
 
-typedef struct {
+struct pcl818_private {
+
        unsigned int dma;       // used DMA, 0=don't use DMA
        int dma_rtc;            // 1=RTC used with DMA, 0=no RTC alloc
        unsigned int io_range;
@@ -356,14 +359,15 @@ typedef struct {
        struct comedi_subdevice *sub_ai;        // ptr to AI subdevice
        unsigned char usefifo;  // 1=use fifo
        unsigned int ao_readback[2];
-} pcl818_private;
+};
+
 
 static const unsigned int muxonechan[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,     // used for gain list programming
        0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff
 };
 
-#define devpriv ((pcl818_private *)dev->private)
-#define this_board ((const boardtype *)dev->board_ptr)
+#define devpriv ((struct pcl818_private *)dev->private)
+#define this_board ((const struct pcl818_board *)dev->board_ptr)
 
 /*
 ==============================================================================
@@ -388,7 +392,7 @@ static int rtc_setfreq_irq(int freq);
    ANALOG INPUT MODE0, 818 cards, slow version
 */
 static int pcl818_ai_insn_read(struct comedi_device * dev, struct comedi_subdevice * s,
-       comedi_insn * insn, unsigned int * data)
+       struct comedi_insn * insn, unsigned int * data)
 {
        int n;
        int timeout;
@@ -435,7 +439,7 @@ static int pcl818_ai_insn_read(struct comedi_device * dev, struct comedi_subdevi
    only one sample per call is supported
 */
 static int pcl818_ao_insn_read(struct comedi_device * dev, struct comedi_subdevice * s,
-       comedi_insn * insn, unsigned int * data)
+       struct comedi_insn * insn, unsigned int * data)
 {
        int n;
        int chan = CR_CHAN(insn->chanspec);
@@ -448,7 +452,7 @@ static int pcl818_ao_insn_read(struct comedi_device * dev, struct comedi_subdevi
 }
 
 static int pcl818_ao_insn_write(struct comedi_device * dev, struct comedi_subdevice * s,
-       comedi_insn * insn, unsigned int * data)
+       struct comedi_insn * insn, unsigned int * data)
 {
        int n;
        int chan = CR_CHAN(insn->chanspec);
@@ -471,7 +475,7 @@ static int pcl818_ao_insn_write(struct comedi_device * dev, struct comedi_subdev
    only one sample per call is supported
 */
 static int pcl818_di_insn_bits(struct comedi_device * dev, struct comedi_subdevice * s,
-       comedi_insn * insn, unsigned int * data)
+       struct comedi_insn * insn, unsigned int * data)
 {
        if (insn->n != 2)
                return -EINVAL;
@@ -489,7 +493,7 @@ static int pcl818_di_insn_bits(struct comedi_device * dev, struct comedi_subdevi
    only one sample per call is supported
 */
 static int pcl818_do_insn_bits(struct comedi_device * dev, struct comedi_subdevice * s,
-       comedi_insn * insn, unsigned int * data)
+       struct comedi_insn * insn, unsigned int * data)
 {
        if (insn->n != 2)
                return -EINVAL;
@@ -955,7 +959,7 @@ static void pcl818_ai_mode13dma_rtc(int mode, struct comedi_device * dev,
 static int pcl818_ai_cmd_mode(int mode, struct comedi_device * dev,
        struct comedi_subdevice * s)
 {
-       comedi_cmd *cmd = &s->async->cmd;
+       struct comedi_cmd *cmd = &s->async->cmd;
        int divisor1, divisor2;
        unsigned int seglen;
 
@@ -1252,7 +1256,7 @@ static int check_single_ended(unsigned int port)
 ==============================================================================
 */
 static int ai_cmdtest(struct comedi_device * dev, struct comedi_subdevice * s,
-       comedi_cmd * cmd)
+       struct comedi_cmd * cmd)
 {
        int err = 0;
        int tmp, divisor1, divisor2;
@@ -1398,7 +1402,7 @@ static int ai_cmdtest(struct comedi_device * dev, struct comedi_subdevice * s,
 */
 static int ai_cmd(struct comedi_device * dev, struct comedi_subdevice * s)
 {
-       comedi_cmd *cmd = &s->async->cmd;
+       struct comedi_cmd *cmd = &s->async->cmd;
        int retval;
 
        rt_printk("pcl818_ai_cmd()\n");
@@ -1675,7 +1679,7 @@ static void free_resources(struct comedi_device * dev)
    Initialization
 
 */
-static int pcl818_attach(struct comedi_device * dev, comedi_devconfig * it)
+static int pcl818_attach(struct comedi_device * dev, struct comedi_devconfig * it)
 {
        int ret;
        unsigned long iobase;
@@ -1683,7 +1687,7 @@ static int pcl818_attach(struct comedi_device * dev, comedi_devconfig * it)
        unsigned long pages;
        struct comedi_subdevice *s;
 
-       if ((ret = alloc_private(dev, sizeof(pcl818_private))) < 0)
+       if ((ret = alloc_private(dev, sizeof(struct pcl818_private))) < 0)
                return ret;     /* Can't alloc mem */
 
        /* claim our I/O space */