diff options
author | Benjamin Adolphi <b.adolphi@googlemail.com> | 2010-02-06 09:02:50 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-03 19:42:55 -0500 |
commit | 0acc516aee7b1527ad125a53deff328ef29be9e6 (patch) | |
tree | b77d7a0a799c2c6f4c6cb56a6971094e2a7e4caa /drivers | |
parent | d3c796fd57f33a20b2ca968e0e449382397c8dba (diff) |
Staging: comedi: dt2815: Checkpatch cleanups
This fixes all checkpatch issues in the dt2815 comedi driver.
Signed-off-by: Benjamin Adolphi <b.adolphi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/comedi/drivers/dt2815.c | 89 |
1 files changed, 39 insertions, 50 deletions
diff --git a/drivers/staging/comedi/drivers/dt2815.c b/drivers/staging/comedi/drivers/dt2815.c index d1db93c043a8..d1a4f7822433 100644 --- a/drivers/staging/comedi/drivers/dt2815.c +++ b/drivers/staging/comedi/drivers/dt2815.c | |||
@@ -34,19 +34,19 @@ Configuration options: | |||
34 | [0] - I/O port base base address | 34 | [0] - I/O port base base address |
35 | [1] - IRQ (unused) | 35 | [1] - IRQ (unused) |
36 | [2] - Voltage unipolar/bipolar configuration | 36 | [2] - Voltage unipolar/bipolar configuration |
37 | 0 == unipolar 5V (0V -- +5V) | 37 | 0 == unipolar 5V (0V -- +5V) |
38 | 1 == bipolar 5V (-5V -- +5V) | 38 | 1 == bipolar 5V (-5V -- +5V) |
39 | [3] - Current offset configuration | 39 | [3] - Current offset configuration |
40 | 0 == disabled (0mA -- +32mAV) | 40 | 0 == disabled (0mA -- +32mAV) |
41 | 1 == enabled (+4mA -- +20mAV) | 41 | 1 == enabled (+4mA -- +20mAV) |
42 | [4] - Firmware program configuration | 42 | [4] - Firmware program configuration |
43 | 0 == program 1 (see manual table 5-4) | 43 | 0 == program 1 (see manual table 5-4) |
44 | 1 == program 2 (see manual table 5-4) | 44 | 1 == program 2 (see manual table 5-4) |
45 | 2 == program 3 (see manual table 5-4) | 45 | 2 == program 3 (see manual table 5-4) |
46 | 3 == program 4 (see manual table 5-4) | 46 | 3 == program 4 (see manual table 5-4) |
47 | [5] - Analog output 0 range configuration | 47 | [5] - Analog output 0 range configuration |
48 | 0 == voltage | 48 | 0 == voltage |
49 | 1 == current | 49 | 1 == current |
50 | [6] - Analog output 1 range configuration (same options) | 50 | [6] - Analog output 1 range configuration (same options) |
51 | [7] - Analog output 2 range configuration (same options) | 51 | [7] - Analog output 2 range configuration (same options) |
52 | [8] - Analog output 3 range configuration (same options) | 52 | [8] - Analog output 3 range configuration (same options) |
@@ -61,17 +61,11 @@ Configuration options: | |||
61 | #include <linux/ioport.h> | 61 | #include <linux/ioport.h> |
62 | #include <linux/delay.h> | 62 | #include <linux/delay.h> |
63 | 63 | ||
64 | static const struct comedi_lrange range_dt2815_ao_32_current = { 1, { | 64 | static const struct comedi_lrange |
65 | RANGE_mA(0, | 65 | range_dt2815_ao_32_current = {1, {RANGE_mA(0, 32)} }; |
66 | 32) | ||
67 | } | ||
68 | }; | ||
69 | 66 | ||
70 | static const struct comedi_lrange range_dt2815_ao_20_current = { 1, { | 67 | static const struct comedi_lrange |
71 | RANGE_mA(4, | 68 | range_dt2815_ao_20_current = {1, {RANGE_mA(4, 20)} }; |
72 | 20) | ||
73 | } | ||
74 | }; | ||
75 | 69 | ||
76 | #define DT2815_SIZE 2 | 70 | #define DT2815_SIZE 2 |
77 | 71 | ||
@@ -118,9 +112,8 @@ static int dt2815_ao_insn_read(struct comedi_device *dev, | |||
118 | int i; | 112 | int i; |
119 | int chan = CR_CHAN(insn->chanspec); | 113 | int chan = CR_CHAN(insn->chanspec); |
120 | 114 | ||
121 | for (i = 0; i < insn->n; i++) { | 115 | for (i = 0; i < insn->n; i++) |
122 | data[i] = devpriv->ao_readback[chan]; | 116 | data[i] = devpriv->ao_readback[chan]; |
123 | } | ||
124 | 117 | ||
125 | return i; | 118 | return i; |
126 | } | 119 | } |
@@ -139,9 +132,8 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s, | |||
139 | 132 | ||
140 | status = dt2815_wait_for_status(dev, 0x00); | 133 | status = dt2815_wait_for_status(dev, 0x00); |
141 | if (status != 0) { | 134 | if (status != 0) { |
142 | printk | 135 | printk(KERN_WARNING "dt2815: failed to write low byte " |
143 | ("dt2815: failed to write low byte on %d reason %x\n", | 136 | "on %d reason %x\n", chan, status); |
144 | chan, status); | ||
145 | return -EBUSY; | 137 | return -EBUSY; |
146 | } | 138 | } |
147 | 139 | ||
@@ -149,9 +141,8 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s, | |||
149 | 141 | ||
150 | status = dt2815_wait_for_status(dev, 0x10); | 142 | status = dt2815_wait_for_status(dev, 0x10); |
151 | if (status != 0x10) { | 143 | if (status != 0x10) { |
152 | printk | 144 | printk(KERN_WARNING "dt2815: failed to write high byte " |
153 | ("dt2815: failed to write high byte on %d reason %x\n", | 145 | "on %d reason %x\n", chan, status); |
154 | chan, status); | ||
155 | return -EBUSY; | 146 | return -EBUSY; |
156 | } | 147 | } |
157 | devpriv->ao_readback[chan] = data[i]; | 148 | devpriv->ao_readback[chan] = data[i]; |
@@ -163,24 +154,24 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s, | |||
163 | options[0] Board base address | 154 | options[0] Board base address |
164 | options[1] IRQ (not applicable) | 155 | options[1] IRQ (not applicable) |
165 | options[2] Voltage unipolar/bipolar configuration | 156 | options[2] Voltage unipolar/bipolar configuration |
166 | 0 == unipolar 5V (0V -- +5V) | 157 | 0 == unipolar 5V (0V -- +5V) |
167 | 1 == bipolar 5V (-5V -- +5V) | 158 | 1 == bipolar 5V (-5V -- +5V) |
168 | options[3] Current offset configuration | 159 | options[3] Current offset configuration |
169 | 0 == disabled (0mA -- +32mAV) | 160 | 0 == disabled (0mA -- +32mAV) |
170 | 1 == enabled (+4mA -- +20mAV) | 161 | 1 == enabled (+4mA -- +20mAV) |
171 | options[4] Firmware program configuration | 162 | options[4] Firmware program configuration |
172 | 0 == program 1 (see manual table 5-4) | 163 | 0 == program 1 (see manual table 5-4) |
173 | 1 == program 2 (see manual table 5-4) | 164 | 1 == program 2 (see manual table 5-4) |
174 | 2 == program 3 (see manual table 5-4) | 165 | 2 == program 3 (see manual table 5-4) |
175 | 3 == program 4 (see manual table 5-4) | 166 | 3 == program 4 (see manual table 5-4) |
176 | options[5] Analog output 0 range configuration | 167 | options[5] Analog output 0 range configuration |
177 | 0 == voltage | 168 | 0 == voltage |
178 | 1 == current | 169 | 1 == current |
179 | options[6] Analog output 1 range configuration | 170 | options[6] Analog output 1 range configuration |
180 | ... | 171 | ... |
181 | options[12] Analog output 7 range configuration | 172 | options[12] Analog output 7 range configuration |
182 | 0 == voltage | 173 | 0 == voltage |
183 | 1 == current | 174 | 1 == current |
184 | */ | 175 | */ |
185 | 176 | ||
186 | static int dt2815_attach(struct comedi_device *dev, struct comedi_devconfig *it) | 177 | static int dt2815_attach(struct comedi_device *dev, struct comedi_devconfig *it) |
@@ -191,9 +182,9 @@ static int dt2815_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
191 | unsigned long iobase; | 182 | unsigned long iobase; |
192 | 183 | ||
193 | iobase = it->options[0]; | 184 | iobase = it->options[0]; |
194 | printk("comedi%d: dt2815: 0x%04lx ", dev->minor, iobase); | 185 | printk(KERN_INFO "comedi%d: dt2815: 0x%04lx ", dev->minor, iobase); |
195 | if (!request_region(iobase, DT2815_SIZE, "dt2815")) { | 186 | if (!request_region(iobase, DT2815_SIZE, "dt2815")) { |
196 | printk("I/O port conflict\n"); | 187 | printk(KERN_WARNING "I/O port conflict\n"); |
197 | return -EIO; | 188 | return -EIO; |
198 | } | 189 | } |
199 | 190 | ||
@@ -236,19 +227,17 @@ static int dt2815_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
236 | unsigned int program; | 227 | unsigned int program; |
237 | program = (it->options[4] & 0x3) << 3 | 0x7; | 228 | program = (it->options[4] & 0x3) << 3 | 0x7; |
238 | outb(program, dev->iobase + DT2815_DATA); | 229 | outb(program, dev->iobase + DT2815_DATA); |
239 | printk(", program: 0x%x (@t=%d)\n", program, i); | 230 | printk(KERN_INFO ", program: 0x%x (@t=%d)\n", |
231 | program, i); | ||
240 | break; | 232 | break; |
241 | } else if (status != 0x00) { | 233 | } else if (status != 0x00) { |
242 | printk("dt2815: unexpected status 0x%x (@t=%d)\n", | 234 | printk(KERN_WARNING "dt2815: unexpected status 0x%x " |
243 | status, i); | 235 | "(@t=%d)\n", status, i); |
244 | if (status & 0x60) { | 236 | if (status & 0x60) |
245 | outb(0x00, dev->iobase + DT2815_STATUS); | 237 | outb(0x00, dev->iobase + DT2815_STATUS); |
246 | } | ||
247 | } | 238 | } |
248 | } | 239 | } |
249 | 240 | ||
250 | printk("\n"); | ||
251 | |||
252 | return 0; | 241 | return 0; |
253 | } | 242 | } |
254 | 243 | ||
@@ -260,7 +249,7 @@ static void dt2815_free_resources(struct comedi_device *dev) | |||
260 | 249 | ||
261 | static int dt2815_detach(struct comedi_device *dev) | 250 | static int dt2815_detach(struct comedi_device *dev) |
262 | { | 251 | { |
263 | printk("comedi%d: dt2815: remove\n", dev->minor); | 252 | printk(KERN_INFO "comedi%d: dt2815: remove\n", dev->minor); |
264 | 253 | ||
265 | dt2815_free_resources(dev); | 254 | dt2815_free_resources(dev); |
266 | 255 | ||