Staging: comedi: cleanup dt2814.c
authorFelipe de Oliveira Tanus <fotanus@gmail.com>
Wed, 10 Mar 2010 05:03:49 +0000 (02:03 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 11 May 2010 18:35:34 +0000 (11:35 -0700)
This patch cleans up the dt2814.c driver file from issues found by
checkpatch.pl tool.

Signed-off-by: Felipe de Oliveira Tanus <fotanus@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/comedi/drivers/dt2814.c

index e1b7375..16fde06 100644 (file)
@@ -99,13 +99,13 @@ static int dt2814_ai_insn_read(struct comedi_device *dev,
                outb(chan, dev->iobase + DT2814_CSR);
                for (i = 0; i < DT2814_TIMEOUT; i++) {
                        status = inb(dev->iobase + DT2814_CSR);
-                       printk("dt2814: status: %02x\n", status);
+                       printk(KERN_INFO "dt2814: status: %02x\n", status);
                        udelay(10);
                        if (status & DT2814_FINISH)
                                break;
                }
                if (i >= DT2814_TIMEOUT) {
-                       printk("dt2814: status: %02x\n", status);
+                       printk(KERN_INFO "dt2814: status: %02x\n", status);
                        return -ETIMEDOUT;
                }
 
@@ -173,7 +173,8 @@ static int dt2814_ai_cmdtest(struct comedi_device *dev,
        if (err)
                return 1;
 
-       /* step 2: make sure trigger sources are unique and mutually compatible */
+       /* step 2: make sure trigger sources are
+        * unique and mutually compatible */
 
        /* note that mutual compatibility is not an issue here */
        if (cmd->stop_src != TRIG_TIMER && cmd->stop_src != TRIG_EXT)
@@ -256,9 +257,9 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        unsigned long iobase;
 
        iobase = it->options[0];
-       printk("comedi%d: dt2814: 0x%04lx ", dev->minor, iobase);
+       printk(KERN_INFO "comedi%d: dt2814: 0x%04lx ", dev->minor, iobase);
        if (!request_region(iobase, DT2814_SIZE, "dt2814")) {
-               printk("I/O port conflict\n");
+               printk(KERN_ERR "I/O port conflict\n");
                return -EIO;
        }
        dev->iobase = iobase;
@@ -267,7 +268,7 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        outb(0, dev->iobase + DT2814_CSR);
        udelay(100);
        if (inb(dev->iobase + DT2814_CSR) & DT2814_ERR) {
-               printk("reset error (fatal)\n");
+               printk(KERN_ERR "reset error (fatal)\n");
                return -EIO;
        }
        i = inb(dev->iobase + DT2814_DATA);
@@ -286,9 +287,9 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
                irq = probe_irq_off(irqs);
                restore_flags(flags);
-               if (inb(dev->iobase + DT2814_CSR) & DT2814_ERR) {
-                       printk("error probing irq (bad) \n");
-               }
+               if (inb(dev->iobase + DT2814_CSR) & DT2814_ERR)
+                       printk(KERN_DEBUG "error probing irq (bad)\n");
+
 
                i = inb(dev->iobase + DT2814_DATA);
                i = inb(dev->iobase + DT2814_DATA);
@@ -297,18 +298,18 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        dev->irq = 0;
        if (irq > 0) {
                if (request_irq(irq, dt2814_interrupt, 0, "dt2814", dev)) {
-                       printk("(irq %d unavailable)\n", irq);
+                       printk(KERN_WARNING "(irq %d unavailable)\n", irq);
                } else {
-                       printk("( irq = %d )\n", irq);
+                       printk(KERN_INFO "( irq = %d )\n", irq);
                        dev->irq = irq;
                }
        } else if (irq == 0) {
-               printk("(no irq)\n");
+               printk(KERN_WARNING "(no irq)\n");
        } else {
 #if 0
-               printk("(probe returned multiple irqs--bad)\n");
+               printk(KERN_DEBUG "(probe returned multiple irqs--bad)\n");
 #else
-               printk("(irq probe not implemented)\n");
+               printk(KERN_WARNING "(irq probe not implemented)\n");
 #endif
        }
 
@@ -337,14 +338,13 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 static int dt2814_detach(struct comedi_device *dev)
 {
-       printk("comedi%d: dt2814: remove\n", dev->minor);
+       printk(KERN_INFO "comedi%d: dt2814: remove\n", dev->minor);
 
-       if (dev->irq) {
+       if (dev->irq)
                free_irq(dev->irq, dev);
-       }
-       if (dev->iobase) {
+
+       if (dev->iobase)
                release_region(dev->iobase, DT2814_SIZE);
-       }
 
        return 0;
 }