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
...@@ -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];
...@@ -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,18 +227,16 @@ static int dt2815_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -236,18 +227,16 @@ 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