Commit 3b9fdcd5 authored by Iain Churcher's avatar Iain Churcher Committed by Greg Kroah-Hartman

Staging: comedi: Fix all checkpatch.pl issues in dt2811.c

Patch resolves all checkpatch.pl isues in dt2811.c
Signed-off-by: default avatarIain Churcher <iain.linux.coding@googlemail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent aad4029a
...@@ -34,13 +34,13 @@ Configuration options: ...@@ -34,13 +34,13 @@ Configuration options:
[0] - I/O port base address [0] - I/O port base address
[1] - IRQ, although this is currently unused [1] - IRQ, although this is currently unused
[2] - A/D reference [2] - A/D reference
0 = signle-ended 0 = signle-ended
1 = differential 1 = differential
2 = pseudo-differential (common reference) 2 = pseudo-differential (common reference)
[3] - A/D range [3] - A/D range
0 = [-5,5] 0 = [-5, 5]
1 = [-2.5,2.5] 1 = [-2.5, 2.5]
2 = [0,5] 2 = [0, 5]
[4] - D/A 0 range (same choices) [4] - D/A 0 range (same choices)
[4] - D/A 1 range (same choices) [4] - D/A 1 range (same choices)
*/ */
...@@ -52,96 +52,58 @@ Configuration options: ...@@ -52,96 +52,58 @@ Configuration options:
static const char *driver_name = "dt2811"; static const char *driver_name = "dt2811";
static const struct comedi_lrange range_dt2811_pgh_ai_5_unipolar = { 4, { static const struct comedi_lrange range_dt2811_pgh_ai_5_unipolar = {
RANGE 4, {
(0, 5), RANGE(0, 5),
RANGE RANGE(0, 2.5),
(0, RANGE(0, 1.25),
2.5), RANGE(0, 0.625)
RANGE }
(0,
1.25),
RANGE
(0,
0.625)
}
}; };
static const struct comedi_lrange range_dt2811_pgh_ai_2_5_bipolar = { 4, { static const struct comedi_lrange range_dt2811_pgh_ai_2_5_bipolar = {
RANGE 4, {
(-2.5, RANGE(-2.5, 2.5),
2.5), RANGE(-1.25, 1.25),
RANGE RANGE(-0.625, 0.625),
(-1.25, RANGE(-0.3125, 0.3125)
1.25), }
RANGE
(-0.625,
0.625),
RANGE
(-0.3125,
0.3125)
}
}; };
static const struct comedi_lrange range_dt2811_pgh_ai_5_bipolar = { 4, { static const struct comedi_lrange range_dt2811_pgh_ai_5_bipolar = {
RANGE 4, {
(-5, 5), RANGE(-5, 5),
RANGE RANGE(-2.5, 2.5),
(-2.5, RANGE(-1.25, 1.25),
2.5), RANGE(-0.625, 0.625)
RANGE }
(-1.25,
1.25),
RANGE
(-0.625,
0.625)
}
}; };
static const struct comedi_lrange range_dt2811_pgl_ai_5_unipolar = { 4, { static const struct comedi_lrange range_dt2811_pgl_ai_5_unipolar = {
RANGE 4, {
(0, 5), RANGE(0, 5),
RANGE RANGE(0, 0.5),
(0, RANGE(0, 0.05),
0.5), RANGE(0, 0.01)
RANGE }
(0,
0.05),
RANGE
(0,
0.01)
}
}; };
static const struct comedi_lrange range_dt2811_pgl_ai_2_5_bipolar = { 4, { static const struct comedi_lrange range_dt2811_pgl_ai_2_5_bipolar = {
RANGE 4, {
(-2.5, RANGE(-2.5, 2.5),
2.5), RANGE(-0.25, 0.25),
RANGE RANGE(-0.025, 0.025),
(-0.25, RANGE(-0.005, 0.005)
0.25), }
RANGE
(-0.025,
0.025),
RANGE
(-0.005,
0.005)
}
}; };
static const struct comedi_lrange range_dt2811_pgl_ai_5_bipolar = { 4, { static const struct comedi_lrange range_dt2811_pgl_ai_5_bipolar = {
RANGE 4, {
(-5, 5), RANGE(-5, 5),
RANGE RANGE(-0.5, 0.5),
(-0.5, RANGE(-0.05, 0.05),
0.5), RANGE(-0.01, 0.01)
RANGE }
(-0.05,
0.05),
RANGE
(-0.01,
0.01)
}
}; };
/* /*
...@@ -348,21 +310,21 @@ static irqreturn_t dt2811_interrupt(int irq, void *d) ...@@ -348,21 +310,21 @@ static irqreturn_t dt2811_interrupt(int irq, void *d)
options[0] Board base address options[0] Board base address
options[1] IRQ options[1] IRQ
options[2] Input configuration options[2] Input configuration
0 == single-ended 0 == single-ended
1 == differential 1 == differential
2 == pseudo-differential 2 == pseudo-differential
options[3] Analog input range configuration options[3] Analog input range configuration
0 == bipolar 5 (-5V -- +5V) 0 == bipolar 5 (-5V -- +5V)
1 == bipolar 2.5V (-2.5V -- +2.5V) 1 == bipolar 2.5V (-2.5V -- +2.5V)
2 == unipolar 5V (0V -- +5V) 2 == unipolar 5V (0V -- +5V)
options[4] Analog output 0 range configuration options[4] Analog output 0 range configuration
0 == bipolar 5 (-5V -- +5V) 0 == bipolar 5 (-5V -- +5V)
1 == bipolar 2.5V (-2.5V -- +2.5V) 1 == bipolar 2.5V (-2.5V -- +2.5V)
2 == unipolar 5V (0V -- +5V) 2 == unipolar 5V (0V -- +5V)
options[5] Analog output 1 range configuration options[5] Analog output 1 range configuration
0 == bipolar 5 (-5V -- +5V) 0 == bipolar 5 (-5V -- +5V)
1 == bipolar 2.5V (-2.5V -- +2.5V) 1 == bipolar 2.5V (-2.5V -- +2.5V)
2 == unipolar 5V (0V -- +5V) 2 == unipolar 5V (0V -- +5V)
*/ */
static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it) static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it)
...@@ -377,10 +339,10 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -377,10 +339,10 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it)
iobase = it->options[0]; iobase = it->options[0];
printk("comedi%d: dt2811: base=0x%04lx\n", dev->minor, iobase); printk(KERN_INFO "comedi%d: dt2811:base=0x%04lx\n", dev->minor, iobase);
if (!request_region(iobase, DT2811_SIZE, driver_name)) { if (!request_region(iobase, DT2811_SIZE, driver_name)) {
printk("I/O port conflict\n"); printk(KERN_ERR "I/O port conflict\n");
return -EIO; return -EIO;
} }
...@@ -410,25 +372,25 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -410,25 +372,25 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it)
irq = probe_irq_off(irqs); irq = probe_irq_off(irqs);
restore_flags(flags); restore_flags(flags);
/*outb(DT2811_CLRERROR|DT2811_INTENB,dev->iobase+DT2811_ADCSR); */ /*outb(DT2811_CLRERROR|DT2811_INTENB,
dev->iobase+DT2811_ADCSR);*/
if (inb(dev->iobase + DT2811_ADCSR) & DT2811_ADERROR) { if (inb(dev->iobase + DT2811_ADCSR) & DT2811_ADERROR)
printk("error probing irq (bad) \n"); printk(KERN_ERR "error probing irq (bad)\n");
}
dev->irq = 0; dev->irq = 0;
if (irq > 0) { if (irq > 0) {
i = inb(dev->iobase + DT2811_ADDATLO); i = inb(dev->iobase + DT2811_ADDATLO);
i = inb(dev->iobase + DT2811_ADDATHI); i = inb(dev->iobase + DT2811_ADDATHI);
printk("(irq = %d)\n", irq); printk(KERN_INFO "(irq = %d)\n", irq);
ret = request_irq(irq, dt2811_interrupt, 0, ret = request_irq(irq, dt2811_interrupt, 0,
driver_name, dev); driver_name, dev);
if (ret < 0) if (ret < 0)
return -EIO; return -EIO;
dev->irq = irq; dev->irq = irq;
} else if (irq == 0) { } else if (irq == 0) {
printk("(no irq)\n"); printk(KERN_INFO "(no irq)\n");
} else { } else {
printk("( multiple irq's -- this is bad! )\n"); printk(KERN_ERR "( multiple irq's -- this is bad! )\n");
} }
} }
#endif #endif
...@@ -540,14 +502,12 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -540,14 +502,12 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static int dt2811_detach(struct comedi_device *dev) static int dt2811_detach(struct comedi_device *dev)
{ {
printk("comedi%d: dt2811: remove\n", dev->minor); printk(KERN_INFO "comedi%d: dt2811: remove\n", dev->minor);
if (dev->irq) { if (dev->irq)
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
} if (dev->iobase)
if (dev->iobase) {
release_region(dev->iobase, DT2811_SIZE); release_region(dev->iobase, DT2811_SIZE);
}
return 0; return 0;
} }
...@@ -579,7 +539,7 @@ static int dt2811_ai_insn(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -579,7 +539,7 @@ static int dt2811_ai_insn(struct comedi_device *dev, struct comedi_subdevice *s,
#if 0 #if 0
/* Wow. This is code from the Comedi stone age. But it hasn't been /* Wow. This is code from the Comedi stone age. But it hasn't been
* replaced, so I'll let it stay. */ * replaced, so I'll let it stay. */
int dt2811_adtrig(kdev_t minor, comedi_adtrig * adtrig) int dt2811_adtrig(kdev_t minor, comedi_adtrig *adtrig)
{ {
struct comedi_device *dev = comedi_devices + minor; struct comedi_device *dev = comedi_devices + minor;
...@@ -589,8 +549,10 @@ int dt2811_adtrig(kdev_t minor, comedi_adtrig * adtrig) ...@@ -589,8 +549,10 @@ int dt2811_adtrig(kdev_t minor, comedi_adtrig * adtrig)
switch (dev->i_admode) { switch (dev->i_admode) {
case COMEDI_MDEMAND: case COMEDI_MDEMAND:
dev->ntrig = adtrig->n - 1; dev->ntrig = adtrig->n - 1;
/* not neccessary */
/*printk("dt2811: AD soft trigger\n"); */ /*printk("dt2811: AD soft trigger\n"); */
/*outb(DT2811_CLRERROR|DT2811_INTENB,dev->iobase+DT2811_ADCSR); *//* not neccessary */ /*outb(DT2811_CLRERROR|DT2811_INTENB,
dev->iobase+DT2811_ADCSR); */
outb(dev->curadchan, dev->iobase + DT2811_ADGCR); outb(dev->curadchan, dev->iobase + DT2811_ADGCR);
do_gettimeofday(&trigtime); do_gettimeofday(&trigtime);
break; break;
...@@ -630,9 +592,8 @@ static int dt2811_ao_insn_read(struct comedi_device *dev, ...@@ -630,9 +592,8 @@ static int dt2811_ao_insn_read(struct comedi_device *dev,
chan = CR_CHAN(insn->chanspec); chan = CR_CHAN(insn->chanspec);
for (i = 0; i < insn->n; i++) { for (i = 0; i < insn->n; i++)
data[i] = devpriv->ao_readback[chan]; data[i] = devpriv->ao_readback[chan];
}
return i; return i;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment