Staging: comedi: fl512: Checkpatch cleanups
This fixes all checkpatch issues in the fl512 comedi driver. Signed-off-by: Benjamin Adolphi <b.adolphi@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
d8dfb3882e
commit
27aa732097
1 changed files with 44 additions and 28 deletions
|
@ -76,14 +76,14 @@ static int fl512_ai_insn(struct comedi_device *dev,
|
|||
unsigned long iobase = dev->iobase;
|
||||
|
||||
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
|
||||
* AI a little bit faster. */
|
||||
/* XXX probably can move next step out of for() loop -- will
|
||||
* make AI a little bit faster. */
|
||||
outb(chan, iobase + 2); /* select chan */
|
||||
outb(0, iobase + 3); /* start conversion */
|
||||
/* XXX should test "done" flag instead of delay */
|
||||
udelay(30); /* sleep 30 usec */
|
||||
lo_byte = inb(iobase + 2); /* low 8 byte */
|
||||
hi_byte = inb(iobase + 3) & 0xf; /* high 4 bit and mask */
|
||||
hi_byte = inb(iobase + 3) & 0xf; /* high 4 bit and mask */
|
||||
data[n] = lo_byte + (hi_byte << 8);
|
||||
}
|
||||
return n;
|
||||
|
@ -101,8 +101,10 @@ static int fl512_ao_insn(struct comedi_device *dev,
|
|||
unsigned long iobase = dev->iobase; /* get base address */
|
||||
|
||||
for (n = 0; n < insn->n; n++) { /* write n data set */
|
||||
outb(data[n] & 0x0ff, iobase + 4 + 2 * chan); /* write low byte */
|
||||
outb((data[n] & 0xf00) >> 8, iobase + 4 + 2 * chan); /* write high byte */
|
||||
/* write low 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 */
|
||||
|
||||
devpriv->ao_readback[chan] = data[n];
|
||||
|
@ -121,9 +123,8 @@ static int fl512_ao_insn_readback(struct comedi_device *dev,
|
|||
int n;
|
||||
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];
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
@ -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)
|
||||
{
|
||||
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];
|
||||
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")) {
|
||||
printk(" I/O port conflict\n");
|
||||
printk(KERN_WARNING " I/O port conflict\n");
|
||||
return -EIO;
|
||||
}
|
||||
dev->iobase = iobase;
|
||||
|
@ -149,7 +152,7 @@ static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||
return -ENOMEM;
|
||||
|
||||
#if DEBUG
|
||||
printk("malloc ok\n");
|
||||
printk(KERN_DEBUG "malloc ok\n");
|
||||
#endif
|
||||
|
||||
if (alloc_subdevices(dev, 2) < 0)
|
||||
|
@ -160,24 +163,37 @@ static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
|||
*/
|
||||
/* Analog indput */
|
||||
s = dev->subdevices + 0;
|
||||
s->type = COMEDI_SUBD_AI; /* define subdevice as Analog In */
|
||||
s->subdev_flags = SDF_READABLE | SDF_GROUND; /* you can read it from userspace */
|
||||
s->n_chan = 16; /* Number of Analog input channels */
|
||||
s->maxdata = 0x0fff; /* accept only 12 bits of data */
|
||||
s->range_table = &range_fl512; /* device use one of the ranges */
|
||||
s->insn_read = fl512_ai_insn; /* function to call when read AD */
|
||||
printk("comedi: fl512: subdevice 0 initialized\n");
|
||||
/* define subdevice as Analog In */
|
||||
s->type = COMEDI_SUBD_AI;
|
||||
/* you can read it from userspace */
|
||||
s->subdev_flags = SDF_READABLE | SDF_GROUND;
|
||||
/* Number of Analog input channels */
|
||||
s->n_chan = 16;
|
||||
/* 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 */
|
||||
s = dev->subdevices + 1;
|
||||
s->type = COMEDI_SUBD_AO; /* define subdevice as Analog OUT */
|
||||
s->subdev_flags = SDF_WRITABLE; /* you can write it from userspace */
|
||||
s->n_chan = 2; /* Number of Analog output channels */
|
||||
s->maxdata = 0x0fff; /* accept only 12 bits of data */
|
||||
s->range_table = &range_fl512; /* device use one of the ranges */
|
||||
s->insn_write = fl512_ao_insn; /* function to call when write DA */
|
||||
s->insn_read = fl512_ao_insn_readback; /* function to call when reading DA */
|
||||
printk("comedi: fl512: subdevice 1 initialized\n");
|
||||
/* define subdevice as Analog OUT */
|
||||
s->type = COMEDI_SUBD_AO;
|
||||
/* you can write it from userspace */
|
||||
s->subdev_flags = SDF_WRITABLE;
|
||||
/* Number of Analog output channels */
|
||||
s->n_chan = 2;
|
||||
/* accept only 12 bits of data */
|
||||
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;
|
||||
}
|
||||
|
@ -186,6 +202,6 @@ static int fl512_detach(struct comedi_device *dev)
|
|||
{
|
||||
if (dev->iobase)
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue