Commit 3c9cd618 authored by Bruce Jones's avatar Bruce Jones Committed by Greg Kroah-Hartman

Staging: comedi: ni_atmio16d: printk fixups

Fix improper use of printks in this driver.  Most are
debug messages under a DEBUG #ifdef, a few are info/warnings
that should get logged for driver error conditions.
Signed-off-by: default avatarBruce Jones <brucej@linux.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ce5ade4f
...@@ -279,7 +279,9 @@ static irqreturn_t atmio16d_interrupt(int irq, void *d) ...@@ -279,7 +279,9 @@ static irqreturn_t atmio16d_interrupt(int irq, void *d)
struct comedi_device *dev = d; struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->subdevices + 0; struct comedi_subdevice *s = dev->subdevices + 0;
/* printk("atmio16d_interrupt!\n"); */ #ifdef DEBUG1
printk(KERN_DEBUG "atmio16d_interrupt!\n");
#endif
comedi_buf_put(s->async, inw(dev->iobase + AD_FIFO_REG)); comedi_buf_put(s->async, inw(dev->iobase + AD_FIFO_REG));
...@@ -293,7 +295,7 @@ static int atmio16d_ai_cmdtest(struct comedi_device *dev, ...@@ -293,7 +295,7 @@ static int atmio16d_ai_cmdtest(struct comedi_device *dev,
{ {
int err = 0, tmp; int err = 0, tmp;
#ifdef DEBUG1 #ifdef DEBUG1
printk("atmio16d_ai_cmdtest\n"); printk(KERN_DEBUG "atmio16d_ai_cmdtest\n");
#endif #endif
/* make sure triggers are valid */ /* make sure triggers are valid */
tmp = cmd->start_src; tmp = cmd->start_src;
...@@ -397,7 +399,7 @@ static int atmio16d_ai_cmd(struct comedi_device *dev, ...@@ -397,7 +399,7 @@ static int atmio16d_ai_cmd(struct comedi_device *dev,
unsigned int sample_count, tmp, chan, gain; unsigned int sample_count, tmp, chan, gain;
int i; int i;
#ifdef DEBUG1 #ifdef DEBUG1
printk("atmio16d_ai_cmd\n"); printk(KERN_DEBUG "atmio16d_ai_cmd\n");
#endif #endif
/* This is slowly becoming a working command interface. * /* This is slowly becoming a working command interface. *
* It is still uber-experimental */ * It is still uber-experimental */
...@@ -559,7 +561,7 @@ static int atmio16d_ai_insn_read(struct comedi_device *dev, ...@@ -559,7 +561,7 @@ static int atmio16d_ai_insn_read(struct comedi_device *dev,
int status; int status;
#ifdef DEBUG1 #ifdef DEBUG1
printk("atmio16d_ai_insn_read\n"); printk(KERN_DEBUG "atmio16d_ai_insn_read\n");
#endif #endif
chan = CR_CHAN(insn->chanspec); chan = CR_CHAN(insn->chanspec);
gain = CR_RANGE(insn->chanspec); gain = CR_RANGE(insn->chanspec);
...@@ -580,7 +582,7 @@ static int atmio16d_ai_insn_read(struct comedi_device *dev, ...@@ -580,7 +582,7 @@ static int atmio16d_ai_insn_read(struct comedi_device *dev,
/* check conversion status */ /* check conversion status */
status = inw(dev->iobase + STAT_REG); status = inw(dev->iobase + STAT_REG);
#ifdef DEBUG1 #ifdef DEBUG1
printk("status=%x\n", status); printk(KERN_DEBUG "status=%x\n", status);
#endif #endif
if (status & STAT_AD_CONVAVAIL) { if (status & STAT_AD_CONVAVAIL) {
/* read the data now */ /* read the data now */
...@@ -591,7 +593,7 @@ static int atmio16d_ai_insn_read(struct comedi_device *dev, ...@@ -591,7 +593,7 @@ static int atmio16d_ai_insn_read(struct comedi_device *dev,
break; break;
} }
if (status & STAT_AD_OVERFLOW) { if (status & STAT_AD_OVERFLOW) {
printk("atmio16d: a/d FIFO overflow\n"); printk(KERN_INFO "atmio16d: a/d FIFO overflow\n");
outw(0, dev->iobase + AD_CLEAR_REG); outw(0, dev->iobase + AD_CLEAR_REG);
return -ETIME; return -ETIME;
...@@ -599,7 +601,7 @@ static int atmio16d_ai_insn_read(struct comedi_device *dev, ...@@ -599,7 +601,7 @@ static int atmio16d_ai_insn_read(struct comedi_device *dev,
} }
/* end waiting, now check if it timed out */ /* end waiting, now check if it timed out */
if (t == ATMIO16D_TIMEOUT) { if (t == ATMIO16D_TIMEOUT) {
printk("atmio16d: timeout\n"); printk(KERN_INFO "atmio16d: timeout\n");
return -ETIME; return -ETIME;
} }
...@@ -614,7 +616,7 @@ static int atmio16d_ao_insn_read(struct comedi_device *dev, ...@@ -614,7 +616,7 @@ static int atmio16d_ao_insn_read(struct comedi_device *dev,
{ {
int i; int i;
#ifdef DEBUG1 #ifdef DEBUG1
printk("atmio16d_ao_insn_read\n"); printk(KERN_DEBUG "atmio16d_ao_insn_read\n");
#endif #endif
for (i = 0; i < insn->n; i++) for (i = 0; i < insn->n; i++)
...@@ -630,7 +632,7 @@ static int atmio16d_ao_insn_write(struct comedi_device *dev, ...@@ -630,7 +632,7 @@ static int atmio16d_ao_insn_write(struct comedi_device *dev,
int chan; int chan;
int d; int d;
#ifdef DEBUG1 #ifdef DEBUG1
printk("atmio16d_ao_insn_write\n"); printk(KERN_DEBUG "atmio16d_ao_insn_write\n");
#endif #endif
chan = CR_CHAN(insn->chanspec); chan = CR_CHAN(insn->chanspec);
...@@ -740,7 +742,7 @@ static int atmio16d_attach(struct comedi_device *dev, ...@@ -740,7 +742,7 @@ static int atmio16d_attach(struct comedi_device *dev,
/* make sure the address range is free and allocate it */ /* make sure the address range is free and allocate it */
iobase = it->options[0]; iobase = it->options[0];
printk("comedi%d: atmio16d: 0x%04lx ", dev->minor, iobase); printk(KERN_INFO "comedi%d: atmio16d: 0x%04lx ", dev->minor, iobase);
if (!request_region(iobase, ATMIO16D_SIZE, "ni_atmio16d")) { if (!request_region(iobase, ATMIO16D_SIZE, "ni_atmio16d")) {
printk("I/O port conflict\n"); printk("I/O port conflict\n");
return -EIO; return -EIO;
...@@ -767,13 +769,13 @@ static int atmio16d_attach(struct comedi_device *dev, ...@@ -767,13 +769,13 @@ static int atmio16d_attach(struct comedi_device *dev,
ret = request_irq(irq, atmio16d_interrupt, 0, "atmio16d", dev); ret = request_irq(irq, atmio16d_interrupt, 0, "atmio16d", dev);
if (ret < 0) { if (ret < 0) {
printk("failed to allocate irq %u\n", irq); printk(KERN_INFO "failed to allocate irq %u\n", irq);
return ret; return ret;
} }
dev->irq = irq; dev->irq = irq;
printk("( irq = %u )\n", irq); printk(KERN_INFO "( irq = %u )\n", irq);
} else { } else {
printk("( no irq )"); printk(KERN_INFO "( no irq )");
} }
/* set device options */ /* set device options */
...@@ -870,7 +872,7 @@ static int atmio16d_attach(struct comedi_device *dev, ...@@ -870,7 +872,7 @@ static int atmio16d_attach(struct comedi_device *dev,
static int atmio16d_detach(struct comedi_device *dev) static int atmio16d_detach(struct comedi_device *dev)
{ {
printk("comedi%d: atmio16d: remove\n", dev->minor); printk(KERN_INFO "comedi%d: atmio16d: remove\n", dev->minor);
if (dev->subdevices && boardtype->has_8255) if (dev->subdevices && boardtype->has_8255)
subdev_8255_cleanup(dev, dev->subdevices + 3); subdev_8255_cleanup(dev, dev->subdevices + 3);
......
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