Replace the printk calls with dev_info, dev_err, etc. Some of the printk strings were missing newlines on the end. Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx> --- drivers/staging/comedi/drivers/das08.c | 35 ++++++++++++++----------------- 1 files changed, 16 insertions(+), 19 deletions(-) diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c index ab1e3f0..996d71a 100644 --- a/drivers/staging/comedi/drivers/das08.c +++ b/drivers/staging/comedi/drivers/das08.c @@ -275,7 +275,7 @@ static int das08_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s, /* clear over-range bits for 16-bit boards */ if (thisboard->ai_nbits == 16) if (inb(dev->iobase + DAS08_MSB) & 0x80) - printk(KERN_INFO "das08: over-range\n"); + dev_info(dev->class_dev, "over-range\n"); /* trigger conversion */ outb_p(0, dev->iobase + DAS08_TRIG_12BIT); @@ -285,7 +285,7 @@ static int das08_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s, break; } if (i == TIMEOUT) { - printk(KERN_ERR "das08: timeout\n"); + dev_err(dev->class_dev, "timeout\n"); return -ETIME; } msb = inb(dev->iobase + DAS08_MSB); @@ -530,11 +530,9 @@ static int das08_counter_read(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { int chan = insn->chanspec; - - /* printk("Reading counter channel %d ",chan); */ data[0] = i8254_read_channel(&devpriv->i8254, chan); - /* printk("=> 0x%08X\n",data[0]); */ - + /* dev_dbg(dev->class_dev, "Read counter channel %d => 0x%08X\n", + chan, data[0]); */ return 1; } @@ -544,7 +542,8 @@ static int das08_counter_write(struct comedi_device *dev, { int chan = insn->chanspec; - /* printk("Writing counter channel %d with 0x%04X\n",chan,data[0]); */ + /* dev_dbg(dev->class_dev, "Writing counter channel %d with 0x%04X\n", + chan,data[0]); */ i8254_write_channel(&devpriv->i8254, chan, data[0]); return 1; @@ -839,10 +838,10 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase) case isa: case pc104: /* allocate ioports for ISA (and PC/104) boards */ - printk(KERN_INFO " iobase 0x%lx\n", iobase); + dev_info(dev->class_dev, "iobase 0x%lx\n", iobase); if (!request_region(iobase, thisboard->iosize, dev->driver->driver_name)) { - printk(KERN_ERR " I/O port conflict\n"); + dev_err(dev->class_dev "I/O port conflict\n"); return -EIO; } break; @@ -856,7 +855,7 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase) break; #endif default: - printk(KERN_ERR " unsupported bus type\n"); + dev_err(dev->class_dev, "unsupported bus type\n"); return -EIO; break; } @@ -979,16 +978,15 @@ static int das08_attach(struct comedi_device *dev, struct comedi_devconfig *it) if (ret < 0) return ret; - printk(KERN_INFO "comedi%d: das08: ", dev->minor); + dev_info(dev->class_dev, "attach\n"); switch (thisboard->bustype) { #if IS_ENABLED(CONFIG_COMEDI_DAS08_PCI) case pci: if (it->options[0] || it->options[1]) { - printk("bus %i slot %i ", + dev_info(dev->class_dev, "pci bus %i slot %i\n", it->options[0], it->options[1]); } - printk("\n"); /* find card */ for_each_pci_dev(pdev) { if (pdev->vendor == PCI_VENDOR_ID_COMPUTERBOARDS @@ -1005,21 +1003,21 @@ static int das08_attach(struct comedi_device *dev, struct comedi_devconfig *it) } } if (!pdev) { - printk(KERN_ERR "No pci das08 cards found\n"); + dev_err(dev->class_dev, "No pci das08 cards found\n"); return -EIO; } devpriv->pdev = pdev; /* enable PCI device and reserve I/O spaces */ if (comedi_pci_enable(pdev, dev->driver->driver_name)) { - printk(KERN_ERR " Error enabling PCI device and " - "requesting regions\n"); + dev_err(dev->class_dev, + "Error enabling PCI device and requesting regions\n"); return -EIO; } /* read base addresses */ pci_iobase = pci_resource_start(pdev, 1); iobase = pci_resource_start(pdev, 2); - printk(KERN_INFO "pcibase 0x%lx iobase 0x%lx\n", - pci_iobase, iobase); + dev_info(dev->class_dev, "pcibase 0x%lx iobase 0x%lx\n", + pci_iobase, iobase); devpriv->pci_iobase = pci_iobase; #if 0 /* We could enable to pci-das08's interrupt here to make it possible @@ -1036,7 +1034,6 @@ static int das08_attach(struct comedi_device *dev, struct comedi_devconfig *it) #endif /* IS_ENABLED(CONFIG_COMEDI_DAS08_PCI) */ default: iobase = it->options[0]; - printk(KERN_INFO "\n"); break; } return das08_common_attach(dev, iobase); -- 1.7.8.6 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel