Devices: [Quatech] DAQP-208 (daqp), DAQP-308
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include "../comedidev.h"
#include <linux/semaphore.h>
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)
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;
}
}
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;
}
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;
}
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;
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;
}