]> Pileus Git - ~andy/linux/commitdiff
Staging: comedi: Altered the way printk is used in 8255.c
authorMark <reodge@gmail.com>
Mon, 17 May 2010 11:34:27 +0000 (19:34 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 18 May 2010 21:49:23 +0000 (14:49 -0700)
This patch moves around the use of printk calls in 8255.c to include accurate
logging levels and in turn fixes a few warnings from checkpatch.

Signed-off-by: Mark Rankilor <reodge@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/comedi/drivers/8255.c

index b2e80dd5c266c81fa59910ad7b994f0e21a57cb2..fe63830bd850bf6711c4ddcdaf834966ff6667c4 100644 (file)
@@ -396,8 +396,6 @@ static int dev_8255_attach(struct comedi_device *dev,
        unsigned long iobase;
        int i;
 
-       printk("comedi%d: 8255:", dev->minor);
-
        dev->board_name = "8255";
 
        for (i = 0; i < COMEDI_NDEVCONFOPTS; i++) {
@@ -406,13 +404,20 @@ static int dev_8255_attach(struct comedi_device *dev,
                        break;
        }
        if (i == 0) {
-               printk(" no devices specified\n");
+               printk(KERN_WARNING
+                      "comedi%d: 8255: no devices specified\n", dev->minor);
                return -EINVAL;
        }
 
        ret = alloc_subdevices(dev, i);
-       if (ret < 0)
+       if (ret < 0) {
+               /* FIXME this printk call should give a proper message, the
+                * below line just maintains previous functionality */
+               printk("comedi%d: 8255:", dev->minor);
                return ret;
+       }
+
+       printk(KERN_INFO "comedi%d: 8255:", dev->minor);
 
        for (i = 0; i < dev->n_subdevices; i++) {
                iobase = it->options[i];
@@ -439,7 +444,7 @@ static int dev_8255_detach(struct comedi_device *dev)
        unsigned long iobase;
        struct comedi_subdevice *s;
 
-       printk("comedi%d: 8255: remove\n", dev->minor);
+       printk(KERN_INFO "comedi%d: 8255: remove\n", dev->minor);
 
        for (i = 0; i < dev->n_subdevices; i++) {
                s = dev->subdevices + i;