staging/comedi: Use dev_ printks in drivers/quatech_daqp_cs.c
authorYAMANE Toshiaki <yamanetoshi@gmail.com>
Sat, 6 Oct 2012 05:52:34 +0000 (14:52 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Oct 2012 19:47:57 +0000 (12:47 -0700)
fixed below checkpatch warnings.
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(...  to printk(KERN_INFO ...
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(...  to printk(KERN_INFO ...
- WARNING: Prefer netdev_notice(netdev, ... then dev_notice(dev, ... then pr_notice(...  to printk(KERN_NOTICE ...

and added pr_fmt.

Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/quatech_daqp_cs.c

index 3e276f7a33806d788c25fd0db6532f826529048a..d15bd8ac3d4f8ed32b66080a4be077b92e2199f0 100644 (file)
@@ -47,6 +47,8 @@ Status: works
 Devices: [Quatech] DAQP-208 (daqp), DAQP-308
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "../comedidev.h"
 #include <linux/semaphore.h>
 
@@ -195,8 +197,8 @@ static struct comedi_driver driver_daqp = {
 
 static void daqp_dump(struct comedi_device *dev)
 {
-       printk(KERN_INFO "DAQP: status %02x; aux status %02x\n",
-              inb(dev->iobase + DAQP_STATUS), inb(dev->iobase + DAQP_AUX));
+       dev_info(dev->class_dev, "status %02x; aux status %02x\n",
+                inb(dev->iobase + DAQP_STATUS), inb(dev->iobase + DAQP_AUX));
 }
 
 static void hex_dump(char *str, void *ptr, int len)
@@ -255,33 +257,29 @@ static enum irqreturn daqp_interrupt(int irq, void *dev_id)
        int status;
 
        if (local == NULL) {
-               printk(KERN_WARNING
-                      "daqp_interrupt(): irq %d for unknown device.\n", irq);
+               pr_warn("irq %d for unknown device.\n", irq);
                return IRQ_NONE;
        }
 
        dev = local->dev;
        if (dev == NULL) {
-               printk(KERN_WARNING "daqp_interrupt(): NULL comedi_device.\n");
+               pr_warn("NULL comedi_device.\n");
                return IRQ_NONE;
        }
 
        if (!dev->attached) {
-               printk(KERN_WARNING
-                      "daqp_interrupt(): struct comedi_device not yet attached.\n");
+               pr_warn("struct comedi_device not yet attached.\n");
                return IRQ_NONE;
        }
 
        s = local->s;
        if (s == NULL) {
-               printk(KERN_WARNING
-                      "daqp_interrupt(): NULL comedi_subdevice.\n");
+               pr_warn("NULL comedi_subdevice.\n");
                return IRQ_NONE;
        }
 
        if ((struct local_info_t *)s->private != local) {
-               printk(KERN_WARNING
-                      "daqp_interrupt(): invalid comedi_subdevice.\n");
+               pr_warn("invalid comedi_subdevice.\n");
                return IRQ_NONE;
        }
 
@@ -331,8 +329,8 @@ static enum irqreturn daqp_interrupt(int irq, void *dev_id)
                }
 
                if (loop_limit <= 0) {
-                       printk(KERN_WARNING
-                              "loop_limit reached in daqp_interrupt()\n");
+                       dev_warn(dev->class_dev,
+                                "loop_limit reached in daqp_interrupt()\n");
                        daqp_ai_cancel(dev, s);
                        s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
                }
@@ -736,8 +734,8 @@ static int daqp_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
        while (--counter
               && (inb(dev->iobase + DAQP_STATUS) & DAQP_STATUS_EVENTS)) ;
        if (!counter) {
-               printk(KERN_ERR
-                      "daqp: couldn't clear interrupts in status register\n");
+               dev_err(dev->class_dev,
+                       "couldn't clear interrupts in status register\n");
                return -1;
        }
 
@@ -852,8 +850,8 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       printk(KERN_INFO "comedi%d: attaching daqp%d (io 0x%04lx)\n",
-              dev->minor, it->options[0], dev->iobase);
+       dev_info(dev->class_dev, "attaching daqp%d (io 0x%04lx)\n",
+                it->options[0], dev->iobase);
 
        s = &dev->subdevices[0];
        dev->read_subdev = s;
@@ -958,7 +956,7 @@ static int daqp_cs_attach(struct pcmcia_device *link)
                if (dev_table[i] == NULL)
                        break;
        if (i == MAX_DEV) {
-               printk(KERN_NOTICE "daqp_cs: no devices available\n");
+               dev_notice(&link->dev, "no devices available\n");
                return -ENODEV;
        }