Commit 4b05d17d authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi: amplc_pci230: Replace printk calls

Replace the printk calls with dev_info, dev_err, etc.

A load of DPRINTK() macro calls which may result in printk() calls
have been left alone to be tackled en masse at a later date.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9dc5a822
...@@ -697,8 +697,8 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -697,8 +697,8 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it)
struct pci_dev *pci_dev = NULL; struct pci_dev *pci_dev = NULL;
int i = 0, irq_hdl, rc; int i = 0, irq_hdl, rc;
printk("comedi%d: amplc_pci230: attach %s %d,%d\n", dev->minor, dev_info(dev->class_dev, "amplc_pci230: attach %s %d,%d\n",
thisboard->name, it->options[0], it->options[1]); thisboard->name, it->options[0], it->options[1]);
/* Allocate the private structure area using alloc_private(). /* Allocate the private structure area using alloc_private().
* Macro defined in comedidev.h - memsets struct fields to 0. */ * Macro defined in comedidev.h - memsets struct fields to 0. */
...@@ -772,8 +772,7 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -772,8 +772,7 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it)
} }
} }
if (!pci_dev) { if (!pci_dev) {
printk("comedi%d: No %s card found\n", dev->minor, dev_err(dev->class_dev, "No %s card found\n", thisboard->name);
thisboard->name);
return -EIO; return -EIO;
} }
devpriv->pci_dev = pci_dev; devpriv->pci_dev = pci_dev;
...@@ -785,8 +784,8 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -785,8 +784,8 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it)
/* Enable PCI device and reserve I/O spaces. */ /* Enable PCI device and reserve I/O spaces. */
if (comedi_pci_enable(pci_dev, "amplc_pci230") < 0) { if (comedi_pci_enable(pci_dev, "amplc_pci230") < 0) {
printk("comedi%d: failed to enable PCI device " dev_err(dev->class_dev,
"and request regions\n", dev->minor); "failed to enable PCI device and request regions\n");
return -EIO; return -EIO;
} }
...@@ -795,8 +794,9 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -795,8 +794,9 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it)
iobase1 = pci_resource_start(pci_dev, 2); iobase1 = pci_resource_start(pci_dev, 2);
iobase2 = pci_resource_start(pci_dev, 3); iobase2 = pci_resource_start(pci_dev, 3);
printk("comedi%d: %s I/O region 1 0x%04lx I/O region 2 0x%04lx\n", dev_dbg(dev->class_dev,
dev->minor, dev->board_name, iobase1, iobase2); "%s I/O region 1 0x%04lx I/O region 2 0x%04lx\n",
dev->board_name, iobase1, iobase2);
devpriv->iobase1 = iobase1; devpriv->iobase1 = iobase1;
dev->iobase = iobase2; dev->iobase = iobase2;
...@@ -811,10 +811,10 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -811,10 +811,10 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it)
devpriv->hwver = inw(dev->iobase + PCI230P_HWVER); devpriv->hwver = inw(dev->iobase + PCI230P_HWVER);
if (devpriv->hwver < thisboard->min_hwver) { if (devpriv->hwver < thisboard->min_hwver) {
printk("comedi%d: %s - bad hardware version " dev_err(dev->class_dev,
"- got %u, need %u\n", dev->minor, "%s - bad hardware version - got %u, need %u\n",
dev->board_name, devpriv->hwver, dev->board_name, devpriv->hwver,
thisboard->min_hwver); thisboard->min_hwver);
return -EIO; return -EIO;
} }
if (devpriv->hwver > 0) { if (devpriv->hwver > 0) {
...@@ -862,13 +862,13 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -862,13 +862,13 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it)
irq_hdl = request_irq(devpriv->pci_dev->irq, pci230_interrupt, irq_hdl = request_irq(devpriv->pci_dev->irq, pci230_interrupt,
IRQF_SHARED, "amplc_pci230", dev); IRQF_SHARED, "amplc_pci230", dev);
if (irq_hdl < 0) { if (irq_hdl < 0) {
printk("comedi%d: unable to register irq, " dev_warn(dev->class_dev,
"commands will not be available %d\n", dev->minor, "unable to register irq %u, commands will not be available\n",
devpriv->pci_dev->irq); devpriv->pci_dev->irq);
} else { } else {
dev->irq = devpriv->pci_dev->irq; dev->irq = devpriv->pci_dev->irq;
printk("comedi%d: registered irq %u\n", dev->minor, dev_dbg(dev->class_dev, "registered irq %u\n",
devpriv->pci_dev->irq); devpriv->pci_dev->irq);
} }
/* /*
...@@ -931,7 +931,7 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -931,7 +931,7 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} }
printk("comedi%d: attached\n", dev->minor); dev_info(dev->class_dev, "attached\n");
return 1; return 1;
} }
...@@ -1117,9 +1117,7 @@ static int pci230_ai_rinsn(struct comedi_device *dev, ...@@ -1117,9 +1117,7 @@ static int pci230_ai_rinsn(struct comedi_device *dev,
udelay(1); udelay(1);
} }
if (i == TIMEOUT) { if (i == TIMEOUT) {
/* printk() should be used instead of printk() dev_err(dev->class_dev, "timeout\n");
* whenever the code can be called from real-time. */
printk("timeout\n");
return -ETIMEDOUT; return -ETIMEDOUT;
} }
...@@ -1992,13 +1990,9 @@ static int pci230_ai_cmdtest(struct comedi_device *dev, ...@@ -1992,13 +1990,9 @@ static int pci230_ai_cmdtest(struct comedi_device *dev,
(s->n_chan / 2) - 1); (s->n_chan / 2) - 1);
} }
if ((errors & buggy_chan0_err) != 0) { if ((errors & buggy_chan0_err) != 0) {
/* Use printk instead of DPRINTK here. */ dev_info(dev->class_dev,
printk("comedi: comedi%d: amplc_pci230: " "amplc_pci230: ai_cmdtest: Buggy PCI230+/260+ h/w version %u requires first channel of multi-channel sequence to be 0 (corrected in h/w version 4)\n",
"ai_cmdtest: Buggy PCI230+/260+ " devpriv->hwver);
"h/w version %u requires first channel "
"of multi-channel sequence to be 0 "
"(corrected in h/w version 4)\n",
dev->minor, devpriv->hwver);
} }
} }
} }
......
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