aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorBenjamin Adolphi <b.adolphi@googlemail.com>2010-01-31 17:29:28 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-03 19:42:54 -0500
commit27aa7320972a130ba3cd2d4004c2568e7c40f01e (patch)
treee1827a25bdb0b685ac8d0edc271c1e9dddb399d9 /drivers/staging/comedi
parentd8dfb3882e12539f34c6eeb01dee6f425e92e892 (diff)
Staging: comedi: fl512: Checkpatch cleanups
This fixes all checkpatch issues in the fl512 comedi driver. Signed-off-by: Benjamin Adolphi <b.adolphi@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r--drivers/staging/comedi/drivers/fl512.c72
1 files changed, 44 insertions, 28 deletions
diff --git a/drivers/staging/comedi/drivers/fl512.c b/drivers/staging/comedi/drivers/fl512.c
index 8fca1804335..a10a2b070a2 100644
--- a/drivers/staging/comedi/drivers/fl512.c
+++ b/drivers/staging/comedi/drivers/fl512.c
@@ -76,14 +76,14 @@ static int fl512_ai_insn(struct comedi_device *dev,
76 unsigned long iobase = dev->iobase; 76 unsigned long iobase = dev->iobase;
77 77
78 for (n = 0; n < insn->n; n++) { /* sample n times on selected channel */ 78 for (n = 0; n < insn->n; n++) { /* sample n times on selected channel */
79 /* XXX probably can move next step out of for() loop -- will make 79 /* XXX probably can move next step out of for() loop -- will
80 * AI a little bit faster. */ 80 * make AI a little bit faster. */
81 outb(chan, iobase + 2); /* select chan */ 81 outb(chan, iobase + 2); /* select chan */
82 outb(0, iobase + 3); /* start conversion */ 82 outb(0, iobase + 3); /* start conversion */
83 /* XXX should test "done" flag instead of delay */ 83 /* XXX should test "done" flag instead of delay */
84 udelay(30); /* sleep 30 usec */ 84 udelay(30); /* sleep 30 usec */
85 lo_byte = inb(iobase + 2); /* low 8 byte */ 85 lo_byte = inb(iobase + 2); /* low 8 byte */
86 hi_byte = inb(iobase + 3) & 0xf; /* high 4 bit and mask */ 86 hi_byte = inb(iobase + 3) & 0xf; /* high 4 bit and mask */
87 data[n] = lo_byte + (hi_byte << 8); 87 data[n] = lo_byte + (hi_byte << 8);
88 } 88 }
89 return n; 89 return n;
@@ -101,8 +101,10 @@ static int fl512_ao_insn(struct comedi_device *dev,
101 unsigned long iobase = dev->iobase; /* get base address */ 101 unsigned long iobase = dev->iobase; /* get base address */
102 102
103 for (n = 0; n < insn->n; n++) { /* write n data set */ 103 for (n = 0; n < insn->n; n++) { /* write n data set */
104 outb(data[n] & 0x0ff, iobase + 4 + 2 * chan); /* write low byte */ 104 /* write low byte */
105 outb((data[n] & 0xf00) >> 8, iobase + 4 + 2 * chan); /* write high byte */ 105 outb(data[n] & 0x0ff, iobase + 4 + 2 * chan);
106 /* write high byte */
107 outb((data[n] & 0xf00) >> 8, iobase + 4 + 2 * chan);
106 inb(iobase + 4 + 2 * chan); /* trig */ 108 inb(iobase + 4 + 2 * chan); /* trig */
107 109
108 devpriv->ao_readback[chan] = data[n]; 110 devpriv->ao_readback[chan] = data[n];
@@ -121,9 +123,8 @@ static int fl512_ao_insn_readback(struct comedi_device *dev,
121 int n; 123 int n;
122 int chan = CR_CHAN(insn->chanspec); 124 int chan = CR_CHAN(insn->chanspec);
123 125
124 for (n = 0; n < insn->n; n++) { 126 for (n = 0; n < insn->n; n++)
125 data[n] = devpriv->ao_readback[chan]; 127 data[n] = devpriv->ao_readback[chan];
126 }
127 128
128 return n; 129 return n;
129} 130}
@@ -134,13 +135,15 @@ static int fl512_ao_insn_readback(struct comedi_device *dev,
134static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it) 135static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it)
135{ 136{
136 unsigned long iobase; 137 unsigned long iobase;
137 struct comedi_subdevice *s; /* pointer to the subdevice: 138
138 Analog in, Analog out, ( not made ->and Digital IO) */ 139 /* pointer to the subdevice: Analog in, Analog out,
140 (not made ->and Digital IO) */
141 struct comedi_subdevice *s;
139 142
140 iobase = it->options[0]; 143 iobase = it->options[0];
141 printk("comedi:%d fl512: 0x%04lx", dev->minor, iobase); 144 printk(KERN_INFO "comedi:%d fl512: 0x%04lx", dev->minor, iobase);
142 if (!request_region(iobase, FL512_SIZE, "fl512")) { 145 if (!request_region(iobase, FL512_SIZE, "fl512")) {
143 printk(" I/O port conflict\n"); 146 printk(KERN_WARNING " I/O port conflict\n");
144 return -EIO; 147 return -EIO;
145 } 148 }
146 dev->iobase = iobase; 149 dev->iobase = iobase;
@@ -149,7 +152,7 @@ static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it)
149 return -ENOMEM; 152 return -ENOMEM;
150 153
151#if DEBUG 154#if DEBUG
152 printk("malloc ok\n"); 155 printk(KERN_DEBUG "malloc ok\n");
153#endif 156#endif
154 157
155 if (alloc_subdevices(dev, 2) < 0) 158 if (alloc_subdevices(dev, 2) < 0)
@@ -160,24 +163,37 @@ static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it)
160 */ 163 */
161 /* Analog indput */ 164 /* Analog indput */
162 s = dev->subdevices + 0; 165 s = dev->subdevices + 0;
163 s->type = COMEDI_SUBD_AI; /* define subdevice as Analog In */ 166 /* define subdevice as Analog In */
164 s->subdev_flags = SDF_READABLE | SDF_GROUND; /* you can read it from userspace */ 167 s->type = COMEDI_SUBD_AI;
165 s->n_chan = 16; /* Number of Analog input channels */ 168 /* you can read it from userspace */
166 s->maxdata = 0x0fff; /* accept only 12 bits of data */ 169 s->subdev_flags = SDF_READABLE | SDF_GROUND;
167 s->range_table = &range_fl512; /* device use one of the ranges */ 170 /* Number of Analog input channels */
168 s->insn_read = fl512_ai_insn; /* function to call when read AD */ 171 s->n_chan = 16;
169 printk("comedi: fl512: subdevice 0 initialized\n"); 172 /* accept only 12 bits of data */
173 s->maxdata = 0x0fff;
174 /* device use one of the ranges */
175 s->range_table = &range_fl512;
176 /* function to call when read AD */
177 s->insn_read = fl512_ai_insn;
178 printk(KERN_INFO "comedi: fl512: subdevice 0 initialized\n");
170 179
171 /* Analog output */ 180 /* Analog output */
172 s = dev->subdevices + 1; 181 s = dev->subdevices + 1;
173 s->type = COMEDI_SUBD_AO; /* define subdevice as Analog OUT */ 182 /* define subdevice as Analog OUT */
174 s->subdev_flags = SDF_WRITABLE; /* you can write it from userspace */ 183 s->type = COMEDI_SUBD_AO;
175 s->n_chan = 2; /* Number of Analog output channels */ 184 /* you can write it from userspace */
176 s->maxdata = 0x0fff; /* accept only 12 bits of data */ 185 s->subdev_flags = SDF_WRITABLE;
177 s->range_table = &range_fl512; /* device use one of the ranges */ 186 /* Number of Analog output channels */
178 s->insn_write = fl512_ao_insn; /* function to call when write DA */ 187 s->n_chan = 2;
179 s->insn_read = fl512_ao_insn_readback; /* function to call when reading DA */ 188 /* accept only 12 bits of data */
180 printk("comedi: fl512: subdevice 1 initialized\n"); 189 s->maxdata = 0x0fff;
190 /* device use one of the ranges */
191 s->range_table = &range_fl512;
192 /* function to call when write DA */
193 s->insn_write = fl512_ao_insn;
194 /* function to call when reading DA */
195 s->insn_read = fl512_ao_insn_readback;
196 printk(KERN_INFO "comedi: fl512: subdevice 1 initialized\n");
181 197
182 return 1; 198 return 1;
183} 199}
@@ -186,6 +202,6 @@ static int fl512_detach(struct comedi_device *dev)
186{ 202{
187 if (dev->iobase) 203 if (dev->iobase)
188 release_region(dev->iobase, FL512_SIZE); 204 release_region(dev->iobase, FL512_SIZE);
189 printk("comedi%d: fl512: dummy i detach\n", dev->minor); 205 printk(KERN_INFO "comedi%d: fl512: dummy i detach\n", dev->minor);
190 return 0; 206 return 0;
191} 207}