Commit 0acc516a authored by Benjamin Adolphi's avatar Benjamin Adolphi Committed by Greg Kroah-Hartman

Staging: comedi: dt2815: Checkpatch cleanups

This fixes all checkpatch issues in the dt2815 comedi driver.
Signed-off-by: default avatarBenjamin Adolphi <b.adolphi@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d3c796fd
...@@ -34,19 +34,19 @@ Configuration options: ...@@ -34,19 +34,19 @@ Configuration options:
[0] - I/O port base base address [0] - I/O port base base address
[1] - IRQ (unused) [1] - IRQ (unused)
[2] - Voltage unipolar/bipolar configuration [2] - Voltage unipolar/bipolar configuration
0 == unipolar 5V (0V -- +5V) 0 == unipolar 5V (0V -- +5V)
1 == bipolar 5V (-5V -- +5V) 1 == bipolar 5V (-5V -- +5V)
[3] - Current offset configuration [3] - Current offset configuration
0 == disabled (0mA -- +32mAV) 0 == disabled (0mA -- +32mAV)
1 == enabled (+4mA -- +20mAV) 1 == enabled (+4mA -- +20mAV)
[4] - Firmware program configuration [4] - Firmware program configuration
0 == program 1 (see manual table 5-4) 0 == program 1 (see manual table 5-4)
1 == program 2 (see manual table 5-4) 1 == program 2 (see manual table 5-4)
2 == program 3 (see manual table 5-4) 2 == program 3 (see manual table 5-4)
3 == program 4 (see manual table 5-4) 3 == program 4 (see manual table 5-4)
[5] - Analog output 0 range configuration [5] - Analog output 0 range configuration
0 == voltage 0 == voltage
1 == current 1 == current
[6] - Analog output 1 range configuration (same options) [6] - Analog output 1 range configuration (same options)
[7] - Analog output 2 range configuration (same options) [7] - Analog output 2 range configuration (same options)
[8] - Analog output 3 range configuration (same options) [8] - Analog output 3 range configuration (same options)
...@@ -61,17 +61,11 @@ Configuration options: ...@@ -61,17 +61,11 @@ Configuration options:
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/delay.h> #include <linux/delay.h>
static const struct comedi_lrange range_dt2815_ao_32_current = { 1, { static const struct comedi_lrange
RANGE_mA(0, range_dt2815_ao_32_current = {1, {RANGE_mA(0, 32)} };
32)
}
};
static const struct comedi_lrange range_dt2815_ao_20_current = { 1, { static const struct comedi_lrange
RANGE_mA(4, range_dt2815_ao_20_current = {1, {RANGE_mA(4, 20)} };
20)
}
};
#define DT2815_SIZE 2 #define DT2815_SIZE 2
...@@ -118,9 +112,8 @@ static int dt2815_ao_insn_read(struct comedi_device *dev, ...@@ -118,9 +112,8 @@ static int dt2815_ao_insn_read(struct comedi_device *dev,
int i; int i;
int chan = CR_CHAN(insn->chanspec); int 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;
} }
...@@ -139,9 +132,8 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -139,9 +132,8 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s,
status = dt2815_wait_for_status(dev, 0x00); status = dt2815_wait_for_status(dev, 0x00);
if (status != 0) { if (status != 0) {
printk printk(KERN_WARNING "dt2815: failed to write low byte "
("dt2815: failed to write low byte on %d reason %x\n", "on %d reason %x\n", chan, status);
chan, status);
return -EBUSY; return -EBUSY;
} }
...@@ -149,9 +141,8 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -149,9 +141,8 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s,
status = dt2815_wait_for_status(dev, 0x10); status = dt2815_wait_for_status(dev, 0x10);
if (status != 0x10) { if (status != 0x10) {
printk printk(KERN_WARNING "dt2815: failed to write high byte "
("dt2815: failed to write high byte on %d reason %x\n", "on %d reason %x\n", chan, status);
chan, status);
return -EBUSY; return -EBUSY;
} }
devpriv->ao_readback[chan] = data[i]; devpriv->ao_readback[chan] = data[i];
...@@ -163,24 +154,24 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -163,24 +154,24 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s,
options[0] Board base address options[0] Board base address
options[1] IRQ (not applicable) options[1] IRQ (not applicable)
options[2] Voltage unipolar/bipolar configuration options[2] Voltage unipolar/bipolar configuration
0 == unipolar 5V (0V -- +5V) 0 == unipolar 5V (0V -- +5V)
1 == bipolar 5V (-5V -- +5V) 1 == bipolar 5V (-5V -- +5V)
options[3] Current offset configuration options[3] Current offset configuration
0 == disabled (0mA -- +32mAV) 0 == disabled (0mA -- +32mAV)
1 == enabled (+4mA -- +20mAV) 1 == enabled (+4mA -- +20mAV)
options[4] Firmware program configuration options[4] Firmware program configuration
0 == program 1 (see manual table 5-4) 0 == program 1 (see manual table 5-4)
1 == program 2 (see manual table 5-4) 1 == program 2 (see manual table 5-4)
2 == program 3 (see manual table 5-4) 2 == program 3 (see manual table 5-4)
3 == program 4 (see manual table 5-4) 3 == program 4 (see manual table 5-4)
options[5] Analog output 0 range configuration options[5] Analog output 0 range configuration
0 == voltage 0 == voltage
1 == current 1 == current
options[6] Analog output 1 range configuration options[6] Analog output 1 range configuration
... ...
options[12] Analog output 7 range configuration options[12] Analog output 7 range configuration
0 == voltage 0 == voltage
1 == current 1 == current
*/ */
static int dt2815_attach(struct comedi_device *dev, struct comedi_devconfig *it) 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,9 +182,9 @@ static int dt2815_attach(struct comedi_device *dev, struct comedi_devconfig *it)
unsigned long iobase; unsigned long iobase;
iobase = it->options[0]; iobase = it->options[0];
printk("comedi%d: dt2815: 0x%04lx ", dev->minor, iobase); printk(KERN_INFO "comedi%d: dt2815: 0x%04lx ", dev->minor, iobase);
if (!request_region(iobase, DT2815_SIZE, "dt2815")) { if (!request_region(iobase, DT2815_SIZE, "dt2815")) {
printk("I/O port conflict\n"); printk(KERN_WARNING "I/O port conflict\n");
return -EIO; return -EIO;
} }
...@@ -236,19 +227,17 @@ static int dt2815_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -236,19 +227,17 @@ static int dt2815_attach(struct comedi_device *dev, struct comedi_devconfig *it)
unsigned int program; unsigned int program;
program = (it->options[4] & 0x3) << 3 | 0x7; program = (it->options[4] & 0x3) << 3 | 0x7;
outb(program, dev->iobase + DT2815_DATA); outb(program, dev->iobase + DT2815_DATA);
printk(", program: 0x%x (@t=%d)\n", program, i); printk(KERN_INFO ", program: 0x%x (@t=%d)\n",
program, i);
break; break;
} else if (status != 0x00) { } else if (status != 0x00) {
printk("dt2815: unexpected status 0x%x (@t=%d)\n", printk(KERN_WARNING "dt2815: unexpected status 0x%x "
status, i); "(@t=%d)\n", status, i);
if (status & 0x60) { if (status & 0x60)
outb(0x00, dev->iobase + DT2815_STATUS); outb(0x00, dev->iobase + DT2815_STATUS);
}
} }
} }
printk("\n");
return 0; return 0;
} }
...@@ -260,7 +249,7 @@ static void dt2815_free_resources(struct comedi_device *dev) ...@@ -260,7 +249,7 @@ static void dt2815_free_resources(struct comedi_device *dev)
static int dt2815_detach(struct comedi_device *dev) static int dt2815_detach(struct comedi_device *dev)
{ {
printk("comedi%d: dt2815: remove\n", dev->minor); printk(KERN_INFO "comedi%d: dt2815: remove\n", dev->minor);
dt2815_free_resources(dev); dt2815_free_resources(dev);
......
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