Commit 27aa7320 authored by Benjamin Adolphi's avatar Benjamin Adolphi Committed by Greg Kroah-Hartman

Staging: comedi: fl512: Checkpatch cleanups

This fixes all checkpatch issues in the fl512 comedi driver.
Signed-off-by: default avatarBenjamin Adolphi <b.adolphi@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d8dfb388
...@@ -76,8 +76,8 @@ static int fl512_ai_insn(struct comedi_device *dev, ...@@ -76,8 +76,8 @@ static int fl512_ai_insn(struct comedi_device *dev,
unsigned long iobase = dev->iobase; unsigned long iobase = dev->iobase;
for (n = 0; n < insn->n; n++) { /* sample n times on selected channel */ for (n = 0; n < insn->n; n++) { /* sample n times on selected channel */
/* XXX probably can move next step out of for() loop -- will make /* XXX probably can move next step out of for() loop -- will
* AI a little bit faster. */ * make AI a little bit faster. */
outb(chan, iobase + 2); /* select chan */ outb(chan, iobase + 2); /* select chan */
outb(0, iobase + 3); /* start conversion */ outb(0, iobase + 3); /* start conversion */
/* XXX should test "done" flag instead of delay */ /* XXX should test "done" flag instead of delay */
...@@ -101,8 +101,10 @@ static int fl512_ao_insn(struct comedi_device *dev, ...@@ -101,8 +101,10 @@ static int fl512_ao_insn(struct comedi_device *dev,
unsigned long iobase = dev->iobase; /* get base address */ unsigned long iobase = dev->iobase; /* get base address */
for (n = 0; n < insn->n; n++) { /* write n data set */ for (n = 0; n < insn->n; n++) { /* write n data set */
outb(data[n] & 0x0ff, iobase + 4 + 2 * chan); /* write low byte */ /* write low byte */
outb((data[n] & 0xf00) >> 8, iobase + 4 + 2 * chan); /* write high byte */ outb(data[n] & 0x0ff, iobase + 4 + 2 * chan);
/* write high byte */
outb((data[n] & 0xf00) >> 8, iobase + 4 + 2 * chan);
inb(iobase + 4 + 2 * chan); /* trig */ inb(iobase + 4 + 2 * chan); /* trig */
devpriv->ao_readback[chan] = data[n]; devpriv->ao_readback[chan] = data[n];
...@@ -121,9 +123,8 @@ static int fl512_ao_insn_readback(struct comedi_device *dev, ...@@ -121,9 +123,8 @@ static int fl512_ao_insn_readback(struct comedi_device *dev,
int n; int n;
int chan = CR_CHAN(insn->chanspec); int chan = CR_CHAN(insn->chanspec);
for (n = 0; n < insn->n; n++) { for (n = 0; n < insn->n; n++)
data[n] = devpriv->ao_readback[chan]; data[n] = devpriv->ao_readback[chan];
}
return n; return n;
} }
...@@ -134,13 +135,15 @@ static int fl512_ao_insn_readback(struct comedi_device *dev, ...@@ -134,13 +135,15 @@ static int fl512_ao_insn_readback(struct comedi_device *dev,
static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it) static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{ {
unsigned long iobase; unsigned long iobase;
struct comedi_subdevice *s; /* pointer to the subdevice:
Analog in, Analog out, ( not made ->and Digital IO) */ /* pointer to the subdevice: Analog in, Analog out,
(not made ->and Digital IO) */
struct comedi_subdevice *s;
iobase = it->options[0]; iobase = it->options[0];
printk("comedi:%d fl512: 0x%04lx", dev->minor, iobase); printk(KERN_INFO "comedi:%d fl512: 0x%04lx", dev->minor, iobase);
if (!request_region(iobase, FL512_SIZE, "fl512")) { if (!request_region(iobase, FL512_SIZE, "fl512")) {
printk(" I/O port conflict\n"); printk(KERN_WARNING " I/O port conflict\n");
return -EIO; return -EIO;
} }
dev->iobase = iobase; dev->iobase = iobase;
...@@ -149,7 +152,7 @@ static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -149,7 +152,7 @@ static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return -ENOMEM; return -ENOMEM;
#if DEBUG #if DEBUG
printk("malloc ok\n"); printk(KERN_DEBUG "malloc ok\n");
#endif #endif
if (alloc_subdevices(dev, 2) < 0) if (alloc_subdevices(dev, 2) < 0)
...@@ -160,24 +163,37 @@ static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -160,24 +163,37 @@ static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it)
*/ */
/* Analog indput */ /* Analog indput */
s = dev->subdevices + 0; s = dev->subdevices + 0;
s->type = COMEDI_SUBD_AI; /* define subdevice as Analog In */ /* define subdevice as Analog In */
s->subdev_flags = SDF_READABLE | SDF_GROUND; /* you can read it from userspace */ s->type = COMEDI_SUBD_AI;
s->n_chan = 16; /* Number of Analog input channels */ /* you can read it from userspace */
s->maxdata = 0x0fff; /* accept only 12 bits of data */ s->subdev_flags = SDF_READABLE | SDF_GROUND;
s->range_table = &range_fl512; /* device use one of the ranges */ /* Number of Analog input channels */
s->insn_read = fl512_ai_insn; /* function to call when read AD */ s->n_chan = 16;
printk("comedi: fl512: subdevice 0 initialized\n"); /* accept only 12 bits of data */
s->maxdata = 0x0fff;
/* device use one of the ranges */
s->range_table = &range_fl512;
/* function to call when read AD */
s->insn_read = fl512_ai_insn;
printk(KERN_INFO "comedi: fl512: subdevice 0 initialized\n");
/* Analog output */ /* Analog output */
s = dev->subdevices + 1; s = dev->subdevices + 1;
s->type = COMEDI_SUBD_AO; /* define subdevice as Analog OUT */ /* define subdevice as Analog OUT */
s->subdev_flags = SDF_WRITABLE; /* you can write it from userspace */ s->type = COMEDI_SUBD_AO;
s->n_chan = 2; /* Number of Analog output channels */ /* you can write it from userspace */
s->maxdata = 0x0fff; /* accept only 12 bits of data */ s->subdev_flags = SDF_WRITABLE;
s->range_table = &range_fl512; /* device use one of the ranges */ /* Number of Analog output channels */
s->insn_write = fl512_ao_insn; /* function to call when write DA */ s->n_chan = 2;
s->insn_read = fl512_ao_insn_readback; /* function to call when reading DA */ /* accept only 12 bits of data */
printk("comedi: fl512: subdevice 1 initialized\n"); s->maxdata = 0x0fff;
/* device use one of the ranges */
s->range_table = &range_fl512;
/* function to call when write DA */
s->insn_write = fl512_ao_insn;
/* function to call when reading DA */
s->insn_read = fl512_ao_insn_readback;
printk(KERN_INFO "comedi: fl512: subdevice 1 initialized\n");
return 1; return 1;
} }
...@@ -186,6 +202,6 @@ static int fl512_detach(struct comedi_device *dev) ...@@ -186,6 +202,6 @@ static int fl512_detach(struct comedi_device *dev)
{ {
if (dev->iobase) if (dev->iobase)
release_region(dev->iobase, FL512_SIZE); release_region(dev->iobase, FL512_SIZE);
printk("comedi%d: fl512: dummy i detach\n", dev->minor); printk(KERN_INFO "comedi%d: fl512: dummy i detach\n", dev->minor);
return 0; return 0;
} }
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