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

staging: comedi: change device used in dev_...() calls

A previous set of patches by Ravishankar Karkala Mallikarjunayya
replaced a load of printk() calls with dev_info(), dev_err(), etc.
Unfortunately, these used the 'struct device *hw_dev' member of 'struct
comedi_device') as the first parameter of these dev_...() calls, but
that pointer is usually NULL, so the kernel log messages come out a bit
wrong (they contain the phrase "(NULL device *)").

Use the 'struct device *class_dev' member of 'struct comedi_device'
instead for these dev_...() calls.  It will be non-NULL and somewhat
meaningful to users.  It's also consistent with those comedi drivers
that already use the class_dev member in their dev_...() calls.

Some of the messages included the format "comedi%d" with the minor
device number used for the "%d".  This is now redundant as it will be
the same as the dev_name() part of the kernel log message produced by
the dev_...() calls.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4ea418b8
...@@ -1347,7 +1347,7 @@ static int pci1710_attach(struct comedi_device *dev, ...@@ -1347,7 +1347,7 @@ static int pci1710_attach(struct comedi_device *dev,
int i; int i;
int board_index; int board_index;
dev_info(dev->hw_dev, "comedi%d: adv_pci1710:\n", dev->minor); dev_info(dev->class_dev, DRV_NAME ": attach\n");
opt_bus = it->options[0]; opt_bus = it->options[0];
opt_slot = it->options[1]; opt_slot = it->options[1];
...@@ -1399,10 +1399,10 @@ static int pci1710_attach(struct comedi_device *dev, ...@@ -1399,10 +1399,10 @@ static int pci1710_attach(struct comedi_device *dev,
if (!pcidev) { if (!pcidev) {
if (opt_bus || opt_slot) { if (opt_bus || opt_slot) {
dev_err(dev->hw_dev, "- Card at b:s %d:%d %s\n", dev_err(dev->class_dev, "- Card at b:s %d:%d %s\n",
opt_bus, opt_slot, errstr); opt_bus, opt_slot, errstr);
} else { } else {
dev_err(dev->hw_dev, "- Card %s\n", errstr); dev_err(dev->class_dev, "- Card %s\n", errstr);
} }
return -EIO; return -EIO;
} }
...@@ -1413,8 +1413,8 @@ static int pci1710_attach(struct comedi_device *dev, ...@@ -1413,8 +1413,8 @@ static int pci1710_attach(struct comedi_device *dev,
irq = pcidev->irq; irq = pcidev->irq;
iobase = pci_resource_start(pcidev, 2); iobase = pci_resource_start(pcidev, 2);
dev_dbg(dev->hw_dev, "b:s:f=%d:%d:%d, io=0x%4lx\n", pci_bus, pci_slot, dev_dbg(dev->class_dev, "b:s:f=%d:%d:%d, io=0x%4lx\n",
pci_func, iobase); pci_bus, pci_slot, pci_func, iobase);
dev->iobase = iobase; dev->iobase = iobase;
...@@ -1444,14 +1444,15 @@ static int pci1710_attach(struct comedi_device *dev, ...@@ -1444,14 +1444,15 @@ static int pci1710_attach(struct comedi_device *dev,
if (request_irq(irq, interrupt_service_pci1710, if (request_irq(irq, interrupt_service_pci1710,
IRQF_SHARED, "Advantech PCI-1710", IRQF_SHARED, "Advantech PCI-1710",
dev)) { dev)) {
dev_dbg(dev->hw_dev, "unable to allocate IRQ %d, DISABLING IT", dev_dbg(dev->class_dev,
"unable to allocate IRQ %d, DISABLING IT",
irq); irq);
irq = 0; /* Can't use IRQ */ irq = 0; /* Can't use IRQ */
} else { } else {
dev_dbg(dev->hw_dev, "irq=%u", irq); dev_dbg(dev->class_dev, "irq=%u", irq);
} }
} else { } else {
dev_dbg(dev->hw_dev, "IRQ disabled"); dev_dbg(dev->class_dev, "IRQ disabled");
} }
} else { } else {
irq = 0; irq = 0;
......
...@@ -1121,16 +1121,18 @@ static int pci_dio_attach(struct comedi_device *dev, ...@@ -1121,16 +1121,18 @@ static int pci_dio_attach(struct comedi_device *dev,
} }
if (!dev->board_ptr) { if (!dev->board_ptr) {
dev_err(dev->hw_dev, "Error: Requested type of the card was not found!\n"); dev_err(dev->class_dev,
"Error: Requested type of the card was not found!\n");
return -EIO; return -EIO;
} }
if (comedi_pci_enable(pcidev, dev->driver->driver_name)) { if (comedi_pci_enable(pcidev, dev->driver->driver_name)) {
dev_err(dev->hw_dev, "Error: Can't enable PCI device and request regions!\n"); dev_err(dev->class_dev,
"Error: Can't enable PCI device and request regions!\n");
return -EIO; return -EIO;
} }
iobase = pci_resource_start(pcidev, this_board->main_pci_region); iobase = pci_resource_start(pcidev, this_board->main_pci_region);
dev_dbg(dev->hw_dev, "b:s:f=%d:%d:%d, io=0x%4lx\n", dev_dbg(dev->class_dev, "b:s:f=%d:%d:%d, io=0x%4lx\n",
pcidev->bus->number, PCI_SLOT(pcidev->devfn), pcidev->bus->number, PCI_SLOT(pcidev->devfn),
PCI_FUNC(pcidev->devfn), iobase); PCI_FUNC(pcidev->devfn), iobase);
......
...@@ -150,7 +150,7 @@ static const struct das16cs_board *das16cs_probe(struct comedi_device *dev, ...@@ -150,7 +150,7 @@ static const struct das16cs_board *das16cs_probe(struct comedi_device *dev,
return das16cs_boards + i; return das16cs_boards + i;
} }
dev_dbg(dev->hw_dev, "unknown board!\n"); dev_dbg(dev->class_dev, "unknown board!\n");
return NULL; return NULL;
} }
...@@ -163,18 +163,18 @@ static int das16cs_attach(struct comedi_device *dev, ...@@ -163,18 +163,18 @@ static int das16cs_attach(struct comedi_device *dev,
int ret; int ret;
int i; int i;
dev_dbg(dev->hw_dev, "comedi%d: cb_das16_cs: attached\n", dev->minor); dev_dbg(dev->class_dev, "cb_das16_cs: attach\n");
link = cur_dev; /* XXX hack */ link = cur_dev; /* XXX hack */
if (!link) if (!link)
return -EIO; return -EIO;
dev->iobase = link->resource[0]->start; dev->iobase = link->resource[0]->start;
dev_dbg(dev->hw_dev, "I/O base=0x%04lx\n", dev->iobase); dev_dbg(dev->class_dev, "I/O base=0x%04lx\n", dev->iobase);
dev_dbg(dev->hw_dev, "fingerprint:\n"); dev_dbg(dev->class_dev, "fingerprint:\n");
for (i = 0; i < 48; i += 2) for (i = 0; i < 48; i += 2)
dev_dbg(dev->hw_dev, "%04x\n", inw(dev->iobase + i)); dev_dbg(dev->class_dev, "%04x\n", inw(dev->iobase + i));
ret = request_irq(link->irq, das16cs_interrupt, ret = request_irq(link->irq, das16cs_interrupt,
...@@ -184,7 +184,7 @@ static int das16cs_attach(struct comedi_device *dev, ...@@ -184,7 +184,7 @@ static int das16cs_attach(struct comedi_device *dev,
dev->irq = link->irq; dev->irq = link->irq;
dev_dbg(dev->hw_dev, "irq=%u\n", dev->irq); dev_dbg(dev->class_dev, "irq=%u\n", dev->irq);
dev->board_ptr = das16cs_probe(dev, link); dev->board_ptr = das16cs_probe(dev, link);
if (!dev->board_ptr) if (!dev->board_ptr)
...@@ -306,7 +306,7 @@ static int das16cs_ai_rinsn(struct comedi_device *dev, ...@@ -306,7 +306,7 @@ static int das16cs_ai_rinsn(struct comedi_device *dev,
break; break;
} }
if (to == TIMEOUT) { if (to == TIMEOUT) {
dev_dbg(dev->hw_dev, "cb_das16_cs: ai timeout\n"); dev_dbg(dev->class_dev, "cb_das16_cs: ai timeout\n");
return -ETIME; return -ETIME;
} }
data[i] = (unsigned short)inw(dev->iobase + 0); data[i] = (unsigned short)inw(dev->iobase + 0);
......
...@@ -567,12 +567,13 @@ static int cb_pcidas_attach(struct comedi_device *dev, ...@@ -567,12 +567,13 @@ static int cb_pcidas_attach(struct comedi_device *dev,
} }
} }
dev_err(dev->hw_dev, "No supported ComputerBoards/MeasurementComputing card found on requested position\n"); dev_err(dev->class_dev,
"No supported ComputerBoards/MeasurementComputing card found on requested position\n");
return -EIO; return -EIO;
found: found:
dev_dbg(dev->hw_dev, "Found %s on bus %i, slot %i\n", dev_dbg(dev->class_dev, "Found %s on bus %i, slot %i\n",
cb_pcidas_boards[index].name, pcidev->bus->number, cb_pcidas_boards[index].name, pcidev->bus->number,
PCI_SLOT(pcidev->devfn)); PCI_SLOT(pcidev->devfn));
...@@ -580,7 +581,8 @@ static int cb_pcidas_attach(struct comedi_device *dev, ...@@ -580,7 +581,8 @@ static int cb_pcidas_attach(struct comedi_device *dev,
* Enable PCI device and reserve I/O ports. * Enable PCI device and reserve I/O ports.
*/ */
if (comedi_pci_enable(pcidev, "cb_pcidas")) { if (comedi_pci_enable(pcidev, "cb_pcidas")) {
dev_err(dev->hw_dev, "Failed to enable PCI device and request regions\n"); dev_err(dev->class_dev,
"Failed to enable PCI device and request regions\n");
return -EIO; return -EIO;
} }
/* /*
...@@ -606,7 +608,7 @@ static int cb_pcidas_attach(struct comedi_device *dev, ...@@ -606,7 +608,7 @@ static int cb_pcidas_attach(struct comedi_device *dev,
/* get irq */ /* get irq */
if (request_irq(devpriv->pci_dev->irq, cb_pcidas_interrupt, if (request_irq(devpriv->pci_dev->irq, cb_pcidas_interrupt,
IRQF_SHARED, "cb_pcidas", dev)) { IRQF_SHARED, "cb_pcidas", dev)) {
dev_dbg(dev->hw_dev, "unable to allocate irq %d\n", dev_dbg(dev->class_dev, "unable to allocate irq %d\n",
devpriv->pci_dev->irq); devpriv->pci_dev->irq);
return -EINVAL; return -EINVAL;
} }
...@@ -807,7 +809,7 @@ static int ai_config_calibration_source(struct comedi_device *dev, ...@@ -807,7 +809,7 @@ static int ai_config_calibration_source(struct comedi_device *dev,
unsigned int source = data[1]; unsigned int source = data[1];
if (source >= num_calibration_sources) { if (source >= num_calibration_sources) {
dev_err(dev->hw_dev, "invalid calibration source: %i\n", dev_err(dev->class_dev, "invalid calibration source: %i\n",
source); source);
return -EINVAL; return -EINVAL;
} }
...@@ -1229,7 +1231,7 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev, ...@@ -1229,7 +1231,7 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
outw(bits, devpriv->control_status + ADCMUX_CONT); outw(bits, devpriv->control_status + ADCMUX_CONT);
#ifdef CB_PCIDAS_DEBUG #ifdef CB_PCIDAS_DEBUG
dev_dbg(dev->hw_dev, "comedi: sent 0x%x to adcmux control\n", bits); dev_dbg(dev->class_dev, "sent 0x%x to adcmux control\n", bits);
#endif #endif
/* load counters */ /* load counters */
...@@ -1256,7 +1258,7 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev, ...@@ -1256,7 +1258,7 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
devpriv->adc_fifo_bits |= INT_FHF; /* interrupt fifo half full */ devpriv->adc_fifo_bits |= INT_FHF; /* interrupt fifo half full */
} }
#ifdef CB_PCIDAS_DEBUG #ifdef CB_PCIDAS_DEBUG
dev_dbg(dev->hw_dev, "comedi: adc_fifo_bits are 0x%x\n", dev_dbg(dev->class_dev, "adc_fifo_bits are 0x%x\n",
devpriv->adc_fifo_bits); devpriv->adc_fifo_bits);
#endif #endif
/* enable (and clear) interrupts */ /* enable (and clear) interrupts */
...@@ -1283,7 +1285,7 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev, ...@@ -1283,7 +1285,7 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
bits |= BURSTE; bits |= BURSTE;
outw(bits, devpriv->control_status + TRIG_CONTSTAT); outw(bits, devpriv->control_status + TRIG_CONTSTAT);
#ifdef CB_PCIDAS_DEBUG #ifdef CB_PCIDAS_DEBUG
dev_dbg(dev->hw_dev, "comedi: sent 0x%x to trig control\n", bits); dev_dbg(dev->class_dev, "sent 0x%x to trig control\n", bits);
#endif #endif
return 0; return 0;
...@@ -1500,7 +1502,7 @@ static int cb_pcidas_ao_inttrig(struct comedi_device *dev, ...@@ -1500,7 +1502,7 @@ static int cb_pcidas_ao_inttrig(struct comedi_device *dev,
spin_lock_irqsave(&dev->spinlock, flags); spin_lock_irqsave(&dev->spinlock, flags);
devpriv->adc_fifo_bits |= DAEMIE | DAHFIE; devpriv->adc_fifo_bits |= DAEMIE | DAHFIE;
#ifdef CB_PCIDAS_DEBUG #ifdef CB_PCIDAS_DEBUG
dev_dbg(dev->hw_dev, "comedi: adc_fifo_bits are 0x%x\n", dev_dbg(dev->class_dev, "adc_fifo_bits are 0x%x\n",
devpriv->adc_fifo_bits); devpriv->adc_fifo_bits);
#endif #endif
/* enable and clear interrupts */ /* enable and clear interrupts */
...@@ -1511,7 +1513,7 @@ static int cb_pcidas_ao_inttrig(struct comedi_device *dev, ...@@ -1511,7 +1513,7 @@ static int cb_pcidas_ao_inttrig(struct comedi_device *dev,
devpriv->ao_control_bits |= DAC_START | DACEN | DAC_EMPTY; devpriv->ao_control_bits |= DAC_START | DACEN | DAC_EMPTY;
outw(devpriv->ao_control_bits, devpriv->control_status + DAC_CSR); outw(devpriv->ao_control_bits, devpriv->control_status + DAC_CSR);
#ifdef CB_PCIDAS_DEBUG #ifdef CB_PCIDAS_DEBUG
dev_dbg(dev->hw_dev, "comedi: sent 0x%x to dac control\n", dev_dbg(dev->class_dev, "sent 0x%x to dac control\n",
devpriv->ao_control_bits); devpriv->ao_control_bits);
#endif #endif
spin_unlock_irqrestore(&dev->spinlock, flags); spin_unlock_irqrestore(&dev->spinlock, flags);
...@@ -1540,8 +1542,8 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d) ...@@ -1540,8 +1542,8 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d)
s5933_status = inl(devpriv->s5933_config + AMCC_OP_REG_INTCSR); s5933_status = inl(devpriv->s5933_config + AMCC_OP_REG_INTCSR);
#ifdef CB_PCIDAS_DEBUG #ifdef CB_PCIDAS_DEBUG
dev_dbg(dev->hw_dev, "intcsr 0x%x\n", s5933_status); dev_dbg(dev->class_dev, "intcsr 0x%x\n", s5933_status);
dev_dbg(dev->hw_dev, "mbef 0x%x\n", dev_dbg(dev->class_dev, "mbef 0x%x\n",
inl(devpriv->s5933_config + AMCC_OP_REG_MBEF)); inl(devpriv->s5933_config + AMCC_OP_REG_MBEF));
#endif #endif
......
...@@ -1701,11 +1701,12 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1701,11 +1701,12 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
return -EIO; return -EIO;
} }
dev_dbg(dev->hw_dev, "Found %s on bus %i, slot %i\n", board(dev)->name, dev_dbg(dev->class_dev, "Found %s on bus %i, slot %i\n",
pcidev->bus->number, PCI_SLOT(pcidev->devfn)); board(dev)->name, pcidev->bus->number, PCI_SLOT(pcidev->devfn));
if (comedi_pci_enable(pcidev, dev->driver->driver_name)) { if (comedi_pci_enable(pcidev, dev->driver->driver_name)) {
dev_warn(dev->hw_dev, "failed to enable PCI device and request regions\n"); dev_warn(dev->class_dev,
"failed to enable PCI device and request regions\n");
return -EIO; return -EIO;
} }
pci_set_master(pcidev); pci_set_master(pcidev);
...@@ -1733,7 +1734,7 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1733,7 +1734,7 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (!priv(dev)->plx9080_iobase || !priv(dev)->main_iobase if (!priv(dev)->plx9080_iobase || !priv(dev)->main_iobase
|| !priv(dev)->dio_counter_iobase) { || !priv(dev)->dio_counter_iobase) {
dev_warn(dev->hw_dev, "failed to remap io memory\n"); dev_warn(dev->class_dev, "failed to remap io memory\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -1769,19 +1770,19 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1769,19 +1770,19 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
priv(dev)->hw_revision = priv(dev)->hw_revision =
hw_revision(dev, readw(priv(dev)->main_iobase + HW_STATUS_REG)); hw_revision(dev, readw(priv(dev)->main_iobase + HW_STATUS_REG));
dev_dbg(dev->hw_dev, "stc hardware revision %i\n", dev_dbg(dev->class_dev, "stc hardware revision %i\n",
priv(dev)->hw_revision); priv(dev)->hw_revision);
init_plx9080(dev); init_plx9080(dev);
init_stc_registers(dev); init_stc_registers(dev);
/* get irq */ /* get irq */
if (request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED, if (request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
"cb_pcidas64", dev)) { "cb_pcidas64", dev)) {
dev_dbg(dev->hw_dev, "unable to allocate irq %u\n", dev_dbg(dev->class_dev, "unable to allocate irq %u\n",
pcidev->irq); pcidev->irq);
return -EINVAL; return -EINVAL;
} }
dev->irq = pcidev->irq; dev->irq = pcidev->irq;
dev_dbg(dev->hw_dev, "irq %u\n", dev->irq); dev_dbg(dev->class_dev, "irq %u\n", dev->irq);
retval = setup_subdevices(dev); retval = setup_subdevices(dev);
if (retval < 0) if (retval < 0)
...@@ -2002,7 +2003,7 @@ static int ai_config_calibration_source(struct comedi_device *dev, ...@@ -2002,7 +2003,7 @@ static int ai_config_calibration_source(struct comedi_device *dev,
else else
num_calibration_sources = 8; num_calibration_sources = 8;
if (source >= num_calibration_sources) { if (source >= num_calibration_sources) {
dev_dbg(dev->hw_dev, "invalid calibration source: %i\n", dev_dbg(dev->class_dev, "invalid calibration source: %i\n",
source); source);
return -EINVAL; return -EINVAL;
} }
...@@ -2834,7 +2835,8 @@ static void pio_drain_ai_fifo_16(struct comedi_device *dev) ...@@ -2834,7 +2835,8 @@ static void pio_drain_ai_fifo_16(struct comedi_device *dev)
} }
if (num_samples < 0) { if (num_samples < 0) {
dev_err(dev->hw_dev, "cb_pcidas64: bug! num_samples < 0\n"); dev_err(dev->class_dev,
"cb_pcidas64: bug! num_samples < 0\n");
break; break;
} }
......
...@@ -294,21 +294,23 @@ static int cb_pcidda_attach(struct comedi_device *dev, ...@@ -294,21 +294,23 @@ static int cb_pcidda_attach(struct comedi_device *dev,
} }
} }
if (!pcidev) { if (!pcidev) {
dev_err(dev->hw_dev, "Not a ComputerBoards/MeasurementComputing card on requested position\n"); dev_err(dev->class_dev,
"Not a ComputerBoards/MeasurementComputing card on requested position\n");
return -EIO; return -EIO;
} }
found: found:
devpriv->pci_dev = pcidev; devpriv->pci_dev = pcidev;
dev->board_ptr = cb_pcidda_boards + index; dev->board_ptr = cb_pcidda_boards + index;
/* "thisboard" macro can be used from here. */ /* "thisboard" macro can be used from here. */
dev_dbg(dev->hw_dev, "Found %s at requested position\n", dev_dbg(dev->class_dev, "Found %s at requested position\n",
thisboard->name); thisboard->name);
/* /*
* Enable PCI device and request regions. * Enable PCI device and request regions.
*/ */
if (comedi_pci_enable(pcidev, thisboard->name)) { if (comedi_pci_enable(pcidev, thisboard->name)) {
dev_err(dev->hw_dev, "cb_pcidda: failed to enable PCI device and request regions\n"); dev_err(dev->class_dev,
"cb_pcidda: failed to enable PCI device and request regions\n");
return -EIO; return -EIO;
} }
...@@ -356,10 +358,10 @@ static int cb_pcidda_attach(struct comedi_device *dev, ...@@ -356,10 +358,10 @@ static int cb_pcidda_attach(struct comedi_device *dev,
s = dev->subdevices + 2; s = dev->subdevices + 2;
subdev_8255_init(dev, s, NULL, devpriv->digitalio + PORT2A); subdev_8255_init(dev, s, NULL, devpriv->digitalio + PORT2A);
dev_dbg(dev->hw_dev, "eeprom:\n"); dev_dbg(dev->class_dev, "eeprom:\n");
for (index = 0; index < EEPROM_SIZE; index++) { for (index = 0; index < EEPROM_SIZE; index++) {
devpriv->eeprom_data[index] = cb_pcidda_read_eeprom(dev, index); devpriv->eeprom_data[index] = cb_pcidda_read_eeprom(dev, index);
dev_dbg(dev->hw_dev, "%i:0x%x\n", index, dev_dbg(dev->class_dev, "%i:0x%x\n", index,
devpriv->eeprom_data[index]); devpriv->eeprom_data[index]);
} }
......
...@@ -155,7 +155,8 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -155,7 +155,8 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
} }
} }
dev_err(dev->hw_dev, "No supported ComputerBoards/MeasurementComputing card found on requested position\n"); dev_err(dev->class_dev,
"No supported ComputerBoards/MeasurementComputing card found on requested position\n");
return -EIO; return -EIO;
found: found:
...@@ -167,8 +168,8 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -167,8 +168,8 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
dev->board_name = thisboard->name; dev->board_name = thisboard->name;
devpriv->pci_dev = pcidev; devpriv->pci_dev = pcidev;
dev_dbg(dev->hw_dev, "Found %s on bus %i, slot %i\n", thisboard->name, dev_dbg(dev->class_dev, "Found %s on bus %i, slot %i\n",
devpriv->pci_dev->bus->number, thisboard->name, devpriv->pci_dev->bus->number,
PCI_SLOT(devpriv->pci_dev->devfn)); PCI_SLOT(devpriv->pci_dev->devfn));
if (comedi_pci_enable(pcidev, thisboard->name)) if (comedi_pci_enable(pcidev, thisboard->name))
return -EIO; return -EIO;
...@@ -185,7 +186,7 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -185,7 +186,7 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
for (i = 0; i < thisboard->n_8255; i++) { for (i = 0; i < thisboard->n_8255; i++) {
subdev_8255_init(dev, dev->subdevices + i, subdev_8255_init(dev, dev->subdevices + i,
NULL, devpriv->dio_reg_base + i * 4); NULL, devpriv->dio_reg_base + i * 4);
dev_dbg(dev->hw_dev, "subdev %d: base = 0x%lx\n", i, dev_dbg(dev->class_dev, "subdev %d: base = 0x%lx\n", i,
devpriv->dio_reg_base + i * 4); devpriv->dio_reg_base + i * 4);
} }
......
...@@ -223,12 +223,13 @@ static int cb_pcimdas_attach(struct comedi_device *dev, ...@@ -223,12 +223,13 @@ static int cb_pcimdas_attach(struct comedi_device *dev,
} }
} }
dev_err(dev->hw_dev, "No supported ComputerBoards/MeasurementComputing card found on requested position\n"); dev_err(dev->class_dev,
"No supported ComputerBoards/MeasurementComputing card found on requested position\n");
return -EIO; return -EIO;
found: found:
dev_dbg(dev->hw_dev, "Found %s on bus %i, slot %i\n", dev_dbg(dev->class_dev, "Found %s on bus %i, slot %i\n",
cb_pcimdas_boards[index].name, pcidev->bus->number, cb_pcimdas_boards[index].name, pcidev->bus->number,
PCI_SLOT(pcidev->devfn)); PCI_SLOT(pcidev->devfn));
...@@ -237,12 +238,14 @@ static int cb_pcimdas_attach(struct comedi_device *dev, ...@@ -237,12 +238,14 @@ static int cb_pcimdas_attach(struct comedi_device *dev,
case 0x56: case 0x56:
break; break;
default: default:
dev_dbg(dev->hw_dev, "THIS CARD IS UNSUPPORTED.\n" dev_dbg(dev->class_dev, "THIS CARD IS UNSUPPORTED.\n");
dev_dbg(dev->class_dev,
"PLEASE REPORT USAGE TO <mocelet@sucs.org>\n"); "PLEASE REPORT USAGE TO <mocelet@sucs.org>\n");
} }
if (comedi_pci_enable(pcidev, "cb_pcimdas")) { if (comedi_pci_enable(pcidev, "cb_pcimdas")) {
dev_err(dev->hw_dev, "Failed to enable PCI device and request regions\n"); dev_err(dev->class_dev,
"Failed to enable PCI device and request regions\n");
return -EIO; return -EIO;
} }
...@@ -252,11 +255,11 @@ static int cb_pcimdas_attach(struct comedi_device *dev, ...@@ -252,11 +255,11 @@ static int cb_pcimdas_attach(struct comedi_device *dev,
devpriv->BADR3 = pci_resource_start(devpriv->pci_dev, 3); devpriv->BADR3 = pci_resource_start(devpriv->pci_dev, 3);
devpriv->BADR4 = pci_resource_start(devpriv->pci_dev, 4); devpriv->BADR4 = pci_resource_start(devpriv->pci_dev, 4);
dev_dbg(dev->hw_dev, "devpriv->BADR0 = 0x%lx\n", devpriv->BADR0); dev_dbg(dev->class_dev, "devpriv->BADR0 = 0x%lx\n", devpriv->BADR0);
dev_dbg(dev->hw_dev, "devpriv->BADR1 = 0x%lx\n", devpriv->BADR1); dev_dbg(dev->class_dev, "devpriv->BADR1 = 0x%lx\n", devpriv->BADR1);
dev_dbg(dev->hw_dev, "devpriv->BADR2 = 0x%lx\n", devpriv->BADR2); dev_dbg(dev->class_dev, "devpriv->BADR2 = 0x%lx\n", devpriv->BADR2);
dev_dbg(dev->hw_dev, "devpriv->BADR3 = 0x%lx\n", devpriv->BADR3); dev_dbg(dev->class_dev, "devpriv->BADR3 = 0x%lx\n", devpriv->BADR3);
dev_dbg(dev->hw_dev, "devpriv->BADR4 = 0x%lx\n", devpriv->BADR4); dev_dbg(dev->class_dev, "devpriv->BADR4 = 0x%lx\n", devpriv->BADR4);
/* Dont support IRQ yet */ /* Dont support IRQ yet */
/* get irq */ /* get irq */
......
...@@ -71,8 +71,8 @@ static int contec_do_insn_bits(struct comedi_device *dev, ...@@ -71,8 +71,8 @@ static int contec_do_insn_bits(struct comedi_device *dev,
struct comedi_insn *insn, unsigned int *data) struct comedi_insn *insn, unsigned int *data)
{ {
dev_dbg(dev->hw_dev, "contec_do_insn_bits called\n"); dev_dbg(dev->class_dev, "contec_do_insn_bits called\n");
dev_dbg(dev->hw_dev, "data: %d %d\n", data[0], data[1]); dev_dbg(dev->class_dev, "data: %d %d\n", data[0], data[1]);
if (insn->n != 2) if (insn->n != 2)
return -EINVAL; return -EINVAL;
...@@ -80,7 +80,7 @@ static int contec_do_insn_bits(struct comedi_device *dev, ...@@ -80,7 +80,7 @@ static int contec_do_insn_bits(struct comedi_device *dev,
if (data[0]) { if (data[0]) {
s->state &= ~data[0]; s->state &= ~data[0];
s->state |= data[0] & data[1]; s->state |= data[0] & data[1];
dev_dbg(dev->hw_dev, "out: %d on %lx\n", s->state, dev_dbg(dev->class_dev, "out: %d on %lx\n", s->state,
dev->iobase + thisboard->out_offs); dev->iobase + thisboard->out_offs);
outw(s->state, dev->iobase + thisboard->out_offs); outw(s->state, dev->iobase + thisboard->out_offs);
} }
...@@ -92,8 +92,8 @@ static int contec_di_insn_bits(struct comedi_device *dev, ...@@ -92,8 +92,8 @@ static int contec_di_insn_bits(struct comedi_device *dev,
struct comedi_insn *insn, unsigned int *data) struct comedi_insn *insn, unsigned int *data)
{ {
dev_dbg(dev->hw_dev, "contec_di_insn_bits called\n"); dev_dbg(dev->class_dev, "contec_di_insn_bits called\n");
dev_dbg(dev->hw_dev, "data: %d %d\n", data[0], data[1]); dev_dbg(dev->class_dev, "data: %d %d\n", data[0], data[1]);
if (insn->n != 2) if (insn->n != 2)
return -EINVAL; return -EINVAL;
......
...@@ -485,7 +485,7 @@ static int daqboard2000_ao_insn_write(struct comedi_device *dev, ...@@ -485,7 +485,7 @@ static int daqboard2000_ao_insn_write(struct comedi_device *dev,
static void daqboard2000_resetLocalBus(struct comedi_device *dev) static void daqboard2000_resetLocalBus(struct comedi_device *dev)
{ {
dev_dbg(dev->hw_dev, "daqboard2000_resetLocalBus\n"); dev_dbg(dev->class_dev, "daqboard2000_resetLocalBus\n");
writel(DAQBOARD2000_SECRLocalBusHi, devpriv->plx + 0x6c); writel(DAQBOARD2000_SECRLocalBusHi, devpriv->plx + 0x6c);
udelay(10000); udelay(10000);
writel(DAQBOARD2000_SECRLocalBusLo, devpriv->plx + 0x6c); writel(DAQBOARD2000_SECRLocalBusLo, devpriv->plx + 0x6c);
...@@ -494,7 +494,7 @@ static void daqboard2000_resetLocalBus(struct comedi_device *dev) ...@@ -494,7 +494,7 @@ static void daqboard2000_resetLocalBus(struct comedi_device *dev)
static void daqboard2000_reloadPLX(struct comedi_device *dev) static void daqboard2000_reloadPLX(struct comedi_device *dev)
{ {
dev_dbg(dev->hw_dev, "daqboard2000_reloadPLX\n"); dev_dbg(dev->class_dev, "daqboard2000_reloadPLX\n");
writel(DAQBOARD2000_SECRReloadLo, devpriv->plx + 0x6c); writel(DAQBOARD2000_SECRReloadLo, devpriv->plx + 0x6c);
udelay(10000); udelay(10000);
writel(DAQBOARD2000_SECRReloadHi, devpriv->plx + 0x6c); writel(DAQBOARD2000_SECRReloadHi, devpriv->plx + 0x6c);
...@@ -505,7 +505,7 @@ static void daqboard2000_reloadPLX(struct comedi_device *dev) ...@@ -505,7 +505,7 @@ static void daqboard2000_reloadPLX(struct comedi_device *dev)
static void daqboard2000_pulseProgPin(struct comedi_device *dev) static void daqboard2000_pulseProgPin(struct comedi_device *dev)
{ {
dev_dbg(dev->hw_dev, "daqboard2000_pulseProgPin 1\n"); dev_dbg(dev->class_dev, "daqboard2000_pulseProgPin 1\n");
writel(DAQBOARD2000_SECRProgPinHi, devpriv->plx + 0x6c); writel(DAQBOARD2000_SECRProgPinHi, devpriv->plx + 0x6c);
udelay(10000); udelay(10000);
writel(DAQBOARD2000_SECRProgPinLo, devpriv->plx + 0x6c); writel(DAQBOARD2000_SECRProgPinLo, devpriv->plx + 0x6c);
...@@ -557,14 +557,14 @@ static int initialize_daqboard2000(struct comedi_device *dev, ...@@ -557,14 +557,14 @@ static int initialize_daqboard2000(struct comedi_device *dev,
secr = readl(devpriv->plx + 0x6c); secr = readl(devpriv->plx + 0x6c);
if (!(secr & DAQBOARD2000_EEPROM_PRESENT)) { if (!(secr & DAQBOARD2000_EEPROM_PRESENT)) {
#ifdef DEBUG_EEPROM #ifdef DEBUG_EEPROM
dev_dbg(dev->hw_dev, "no serial eeprom\n"); dev_dbg(dev->class_dev, "no serial eeprom\n");
#endif #endif
return -EIO; return -EIO;
} }
for (retry = 0; retry < 3; retry++) { for (retry = 0; retry < 3; retry++) {
#ifdef DEBUG_EEPROM #ifdef DEBUG_EEPROM
dev_dbg(dev->hw_dev, "Programming EEPROM try %x\n", retry); dev_dbg(dev->class_dev, "Programming EEPROM try %x\n", retry);
#endif #endif
daqboard2000_resetLocalBus(dev); daqboard2000_resetLocalBus(dev);
...@@ -575,8 +575,8 @@ static int initialize_daqboard2000(struct comedi_device *dev, ...@@ -575,8 +575,8 @@ static int initialize_daqboard2000(struct comedi_device *dev,
if (cpld_array[i] == 0xff if (cpld_array[i] == 0xff
&& cpld_array[i + 1] == 0x20) { && cpld_array[i + 1] == 0x20) {
#ifdef DEBUG_EEPROM #ifdef DEBUG_EEPROM
dev_dbg(dev->hw_dev, "Preamble found at %d\n", dev_dbg(dev->class_dev,
i); "Preamble found at %d\n", i);
#endif #endif
break; break;
} }
...@@ -589,7 +589,7 @@ static int initialize_daqboard2000(struct comedi_device *dev, ...@@ -589,7 +589,7 @@ static int initialize_daqboard2000(struct comedi_device *dev,
} }
if (i >= len) { if (i >= len) {
#ifdef DEBUG_EEPROM #ifdef DEBUG_EEPROM
dev_dbg(dev->hw_dev, "Programmed\n"); dev_dbg(dev->class_dev, "Programmed\n");
#endif #endif
daqboard2000_resetLocalBus(dev); daqboard2000_resetLocalBus(dev);
daqboard2000_reloadPLX(dev); daqboard2000_reloadPLX(dev);
...@@ -733,10 +733,11 @@ static int daqboard2000_attach(struct comedi_device *dev, ...@@ -733,10 +733,11 @@ static int daqboard2000_attach(struct comedi_device *dev,
} }
if (!card) { if (!card) {
if (bus || slot) if (bus || slot)
dev_err(dev->hw_dev, "no daqboard2000 found at bus/slot: %d/%d\n", dev_err(dev->class_dev,
"no daqboard2000 found at bus/slot: %d/%d\n",
bus, slot); bus, slot);
else else
dev_err(dev->hw_dev, "no daqboard2000 found\n"); dev_err(dev->class_dev, "no daqboard2000 found\n");
return -EIO; return -EIO;
} else { } else {
u32 id; u32 id;
...@@ -746,7 +747,7 @@ static int daqboard2000_attach(struct comedi_device *dev, ...@@ -746,7 +747,7 @@ static int daqboard2000_attach(struct comedi_device *dev,
subsystem_device << 16) | card->subsystem_vendor; subsystem_device << 16) | card->subsystem_vendor;
for (i = 0; i < ARRAY_SIZE(boardtypes); i++) { for (i = 0; i < ARRAY_SIZE(boardtypes); i++) {
if (boardtypes[i].id == id) { if (boardtypes[i].id == id) {
dev_dbg(dev->hw_dev, "%s\n", dev_dbg(dev->class_dev, "%s\n",
boardtypes[i].name); boardtypes[i].name);
dev->board_ptr = boardtypes + i; dev->board_ptr = boardtypes + i;
} }
...@@ -761,7 +762,8 @@ static int daqboard2000_attach(struct comedi_device *dev, ...@@ -761,7 +762,8 @@ static int daqboard2000_attach(struct comedi_device *dev,
result = comedi_pci_enable(card, "daqboard2000"); result = comedi_pci_enable(card, "daqboard2000");
if (result < 0) { if (result < 0) {
dev_err(dev->hw_dev, "failed to enable PCI device and request regions\n"); dev_err(dev->class_dev,
"failed to enable PCI device and request regions\n");
return -EIO; return -EIO;
} }
devpriv->got_regions = 1; devpriv->got_regions = 1;
...@@ -791,7 +793,8 @@ static int daqboard2000_attach(struct comedi_device *dev, ...@@ -791,7 +793,8 @@ static int daqboard2000_attach(struct comedi_device *dev,
if (aux_data && aux_len) { if (aux_data && aux_len) {
result = initialize_daqboard2000(dev, aux_data, aux_len); result = initialize_daqboard2000(dev, aux_data, aux_len);
} else { } else {
dev_dbg(dev->hw_dev, "no FPGA initialization code, aborting\n"); dev_dbg(dev->class_dev,
"no FPGA initialization code, aborting\n");
result = -EIO; result = -EIO;
} }
if (result < 0) if (result < 0)
......
...@@ -79,17 +79,18 @@ static int das08_cs_attach(struct comedi_device *dev, ...@@ -79,17 +79,18 @@ static int das08_cs_attach(struct comedi_device *dev,
if (ret < 0) if (ret < 0)
return ret; return ret;
dev_info(dev->hw_dev, "comedi%d: das08_cs:\n", dev->minor); dev_info(dev->class_dev, "das08_cs: attach\n");
/* deal with a pci board */ /* deal with a pci board */
if (thisboard->bustype == pcmcia) { if (thisboard->bustype == pcmcia) {
if (link == NULL) { if (link == NULL) {
dev_err(dev->hw_dev, "no pcmcia cards found\n"); dev_err(dev->class_dev, "no pcmcia cards found\n");
return -EIO; return -EIO;
} }
iobase = link->resource[0]->start; iobase = link->resource[0]->start;
} else { } else {
dev_err(dev->hw_dev, "bug! board does not have PCMCIA bustype\n"); dev_err(dev->class_dev,
"bug! board does not have PCMCIA bustype\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -1405,22 +1405,26 @@ static int das1800_init_dma(struct comedi_device *dev, unsigned int dma0, ...@@ -1405,22 +1405,26 @@ static int das1800_init_dma(struct comedi_device *dev, unsigned int dma0,
devpriv->dma_bits |= DMA_CH7_CH5; devpriv->dma_bits |= DMA_CH7_CH5;
break; break;
default: default:
dev_err(dev->hw_dev, " only supports dma channels 5 through 7\n" dev_err(dev->class_dev,
" Dual dma only allows the following combinations:\n" "only supports dma channels 5 through 7\n");
" dma 5,6 / 6,7 / or 7,5\n"); dev_err(dev->class_dev,
"Dual dma only allows the following combinations:\n");
dev_err(dev->class_dev,
"dma 5,6 / 6,7 / or 7,5\n");
return -EINVAL; return -EINVAL;
break; break;
} }
if (request_dma(dma0, dev->driver->driver_name)) { if (request_dma(dma0, dev->driver->driver_name)) {
dev_err(dev->hw_dev, "failed to allocate dma channel %i\n", dev_err(dev->class_dev,
dma0); "failed to allocate dma channel %i\n", dma0);
return -EINVAL; return -EINVAL;
} }
devpriv->dma0 = dma0; devpriv->dma0 = dma0;
devpriv->dma_current = dma0; devpriv->dma_current = dma0;
if (dma1) { if (dma1) {
if (request_dma(dma1, dev->driver->driver_name)) { if (request_dma(dma1, dev->driver->driver_name)) {
dev_err(dev->hw_dev, "failed to allocate dma channel %i\n", dev_err(dev->class_dev,
"failed to allocate dma channel %i\n",
dma1); dma1);
return -EINVAL; return -EINVAL;
} }
...@@ -1460,7 +1464,7 @@ static int das1800_probe(struct comedi_device *dev) ...@@ -1460,7 +1464,7 @@ static int das1800_probe(struct comedi_device *dev)
case 0x3: case 0x3:
if (board == das1801st_da || board == das1802st_da || if (board == das1801st_da || board == das1802st_da ||
board == das1701st_da || board == das1702st_da) { board == das1701st_da || board == das1702st_da) {
dev_dbg(dev->hw_dev, "Board model: %s\n", dev_dbg(dev->class_dev, "Board model: %s\n",
das1800_boards[board].name); das1800_boards[board].name);
return board; return board;
} }
...@@ -1470,7 +1474,7 @@ static int das1800_probe(struct comedi_device *dev) ...@@ -1470,7 +1474,7 @@ static int das1800_probe(struct comedi_device *dev)
break; break;
case 0x4: case 0x4:
if (board == das1802hr_da || board == das1702hr_da) { if (board == das1802hr_da || board == das1702hr_da) {
dev_dbg(dev->hw_dev, "Board model: %s\n", dev_dbg(dev->class_dev, "Board model: %s\n",
das1800_boards[board].name); das1800_boards[board].name);
return board; return board;
} }
...@@ -1481,7 +1485,7 @@ static int das1800_probe(struct comedi_device *dev) ...@@ -1481,7 +1485,7 @@ static int das1800_probe(struct comedi_device *dev)
case 0x5: case 0x5:
if (board == das1801ao || board == das1802ao || if (board == das1801ao || board == das1802ao ||
board == das1701ao || board == das1702ao) { board == das1701ao || board == das1702ao) {
dev_dbg(dev->hw_dev, "Board model: %s\n", dev_dbg(dev->class_dev, "Board model: %s\n",
das1800_boards[board].name); das1800_boards[board].name);
return board; return board;
} }
...@@ -1491,7 +1495,7 @@ static int das1800_probe(struct comedi_device *dev) ...@@ -1491,7 +1495,7 @@ static int das1800_probe(struct comedi_device *dev)
break; break;
case 0x6: case 0x6:
if (board == das1802hr || board == das1702hr) { if (board == das1802hr || board == das1702hr) {
dev_dbg(dev->hw_dev, "Board model: %s\n", dev_dbg(dev->class_dev, "Board model: %s\n",
das1800_boards[board].name); das1800_boards[board].name);
return board; return board;
} }
...@@ -1502,7 +1506,7 @@ static int das1800_probe(struct comedi_device *dev) ...@@ -1502,7 +1506,7 @@ static int das1800_probe(struct comedi_device *dev)
case 0x7: case 0x7:
if (board == das1801st || board == das1802st || if (board == das1801st || board == das1802st ||
board == das1701st || board == das1702st) { board == das1701st || board == das1702st) {
dev_dbg(dev->hw_dev, "Board model: %s\n", dev_dbg(dev->class_dev, "Board model: %s\n",
das1800_boards[board].name); das1800_boards[board].name);
return board; return board;
} }
...@@ -1512,7 +1516,7 @@ static int das1800_probe(struct comedi_device *dev) ...@@ -1512,7 +1516,7 @@ static int das1800_probe(struct comedi_device *dev)
break; break;
case 0x8: case 0x8:
if (board == das1801hc || board == das1802hc) { if (board == das1801hc || board == das1802hc) {
dev_dbg(dev->hw_dev, "Board model: %s\n", dev_dbg(dev->class_dev, "Board model: %s\n",
das1800_boards[board].name); das1800_boards[board].name);
return board; return board;
} }
...@@ -1559,7 +1563,7 @@ static int das1800_attach(struct comedi_device *dev, ...@@ -1559,7 +1563,7 @@ static int das1800_attach(struct comedi_device *dev,
printk(KERN_CONT "\n"); printk(KERN_CONT "\n");
if (iobase == 0) { if (iobase == 0) {
dev_err(dev->hw_dev, "io base address required\n"); dev_err(dev->class_dev, "io base address required\n");
return -EINVAL; return -EINVAL;
} }
...@@ -1574,7 +1578,7 @@ static int das1800_attach(struct comedi_device *dev, ...@@ -1574,7 +1578,7 @@ static int das1800_attach(struct comedi_device *dev,
board = das1800_probe(dev); board = das1800_probe(dev);
if (board < 0) { if (board < 0) {
dev_err(dev->hw_dev, "unable to determine board type\n"); dev_err(dev->class_dev, "unable to determine board type\n");
return -ENODEV; return -ENODEV;
} }
...@@ -1598,7 +1602,7 @@ static int das1800_attach(struct comedi_device *dev, ...@@ -1598,7 +1602,7 @@ static int das1800_attach(struct comedi_device *dev,
if (irq) { if (irq) {
if (request_irq(irq, das1800_interrupt, 0, if (request_irq(irq, das1800_interrupt, 0,
dev->driver->driver_name, dev)) { dev->driver->driver_name, dev)) {
dev_dbg(dev->hw_dev, "unable to allocate irq %u\n", dev_dbg(dev->class_dev, "unable to allocate irq %u\n",
irq); irq);
return -EINVAL; return -EINVAL;
} }
...@@ -1628,7 +1632,7 @@ static int das1800_attach(struct comedi_device *dev, ...@@ -1628,7 +1632,7 @@ static int das1800_attach(struct comedi_device *dev,
devpriv->irq_dma_bits |= 0x38; devpriv->irq_dma_bits |= 0x38;
break; break;
default: default:
dev_err(dev->hw_dev, "irq out of range\n"); dev_err(dev->class_dev, "irq out of range\n");
return -EINVAL; return -EINVAL;
break; break;
} }
......
...@@ -155,7 +155,7 @@ static irqreturn_t intr_handler(int irq, void *d) ...@@ -155,7 +155,7 @@ static irqreturn_t intr_handler(int irq, void *d)
struct comedi_subdevice *s = dev->subdevices; struct comedi_subdevice *s = dev->subdevices;
if (!dev->attached || devpriv->das6402_ignoreirq) { if (!dev->attached || devpriv->das6402_ignoreirq) {
dev_warn(dev->hw_dev, "BUG: spurious interrupt\n"); dev_warn(dev->class_dev, "BUG: spurious interrupt\n");
return IRQ_HANDLED; return IRQ_HANDLED;
} }
#ifdef DEBUG #ifdef DEBUG
...@@ -202,7 +202,7 @@ static int das6402_ai_cancel(struct comedi_device *dev, ...@@ -202,7 +202,7 @@ static int das6402_ai_cancel(struct comedi_device *dev,
*/ */
devpriv->das6402_ignoreirq = 1; devpriv->das6402_ignoreirq = 1;
dev_dbg(dev->hw_dev, "Stopping acquisition\n"); dev_dbg(dev->class_dev, "Stopping acquisition\n");
devpriv->das6402_ignoreirq = 1; devpriv->das6402_ignoreirq = 1;
outb_p(0x02, dev->iobase + 10); /* disable external trigging */ outb_p(0x02, dev->iobase + 10); /* disable external trigging */
outw_p(SCANL, dev->iobase + 2); /* resets the card fifo */ outw_p(SCANL, dev->iobase + 2); /* resets the card fifo */
...@@ -218,7 +218,7 @@ static int das6402_ai_mode2(struct comedi_device *dev, ...@@ -218,7 +218,7 @@ static int das6402_ai_mode2(struct comedi_device *dev,
struct comedi_subdevice *s, comedi_trig * it) struct comedi_subdevice *s, comedi_trig * it)
{ {
devpriv->das6402_ignoreirq = 1; devpriv->das6402_ignoreirq = 1;
dev_dbg(dev->hw_dev, "Starting acquisition\n"); dev_dbg(dev->class_dev, "Starting acquisition\n");
outb_p(0x03, dev->iobase + 10); /* enable external trigging */ outb_p(0x03, dev->iobase + 10); /* enable external trigging */
outw_p(SCANL, dev->iobase + 2); /* resets the card fifo */ outw_p(SCANL, dev->iobase + 2); /* resets the card fifo */
outb_p(IRQ | CONVSRC | BURSTEN | INTE, dev->iobase + 9); outb_p(IRQ | CONVSRC | BURSTEN | INTE, dev->iobase + 9);
...@@ -289,7 +289,7 @@ static int das6402_attach(struct comedi_device *dev, ...@@ -289,7 +289,7 @@ static int das6402_attach(struct comedi_device *dev,
iobase = 0x300; iobase = 0x300;
if (!request_region(iobase, DAS6402_SIZE, "das6402")) { if (!request_region(iobase, DAS6402_SIZE, "das6402")) {
dev_err(dev->hw_dev, "I/O port conflict\n"); dev_err(dev->class_dev, "I/O port conflict\n");
return -EIO; return -EIO;
} }
dev->iobase = iobase; dev->iobase = iobase;
...@@ -297,7 +297,7 @@ static int das6402_attach(struct comedi_device *dev, ...@@ -297,7 +297,7 @@ static int das6402_attach(struct comedi_device *dev,
/* should do a probe here */ /* should do a probe here */
irq = it->options[0]; irq = it->options[0];
dev_dbg(dev->hw_dev, "( irq = %u )\n", irq); dev_dbg(dev->class_dev, "( irq = %u )\n", irq);
ret = request_irq(irq, intr_handler, 0, "das6402", dev); ret = request_irq(irq, intr_handler, 0, "das6402", dev);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -296,46 +296,47 @@ static int das800_probe(struct comedi_device *dev) ...@@ -296,46 +296,47 @@ static int das800_probe(struct comedi_device *dev)
switch (id_bits) { switch (id_bits) {
case 0x0: case 0x0:
if (board == das800) { if (board == das800) {
dev_dbg(dev->hw_dev, "Board model: DAS-800\n"); dev_dbg(dev->class_dev, "Board model: DAS-800\n");
return board; return board;
} }
if (board == ciodas800) { if (board == ciodas800) {
dev_dbg(dev->hw_dev, "Board model: CIO-DAS800\n"); dev_dbg(dev->class_dev, "Board model: CIO-DAS800\n");
return board; return board;
} }
dev_dbg(dev->hw_dev, "Board model (probed): DAS-800\n"); dev_dbg(dev->class_dev, "Board model (probed): DAS-800\n");
return das800; return das800;
break; break;
case 0x2: case 0x2:
if (board == das801) { if (board == das801) {
dev_dbg(dev->hw_dev, "Board model: DAS-801\n"); dev_dbg(dev->class_dev, "Board model: DAS-801\n");
return board; return board;
} }
if (board == ciodas801) { if (board == ciodas801) {
dev_dbg(dev->hw_dev, "Board model: CIO-DAS801\n"); dev_dbg(dev->class_dev, "Board model: CIO-DAS801\n");
return board; return board;
} }
dev_dbg(dev->hw_dev, "Board model (probed): DAS-801\n"); dev_dbg(dev->class_dev, "Board model (probed): DAS-801\n");
return das801; return das801;
break; break;
case 0x3: case 0x3:
if (board == das802) { if (board == das802) {
dev_dbg(dev->hw_dev, "Board model: DAS-802\n"); dev_dbg(dev->class_dev, "Board model: DAS-802\n");
return board; return board;
} }
if (board == ciodas802) { if (board == ciodas802) {
dev_dbg(dev->hw_dev, "Board model: CIO-DAS802\n"); dev_dbg(dev->class_dev, "Board model: CIO-DAS802\n");
return board; return board;
} }
if (board == ciodas80216) { if (board == ciodas80216) {
dev_dbg(dev->hw_dev, "Board model: CIO-DAS802/16\n"); dev_dbg(dev->class_dev, "Board model: CIO-DAS802/16\n");
return board; return board;
} }
dev_dbg(dev->hw_dev, "Board model (probed): DAS-802\n"); dev_dbg(dev->class_dev, "Board model (probed): DAS-802\n");
return das802; return das802;
break; break;
default: default:
dev_dbg(dev->hw_dev, "Board model: probe returned 0x%x (unknown)\n", dev_dbg(dev->class_dev,
"Board model: probe returned 0x%x (unknown)\n",
id_bits); id_bits);
return board; return board;
break; break;
...@@ -467,42 +468,42 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -467,42 +468,42 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
int board; int board;
int ret; int ret;
dev_info(dev->hw_dev, "comedi%d: das800: io 0x%lx\n", dev->minor, dev_info(dev->class_dev, "das800: io 0x%lx\n", iobase);
iobase);
if (irq) if (irq)
dev_dbg(dev->hw_dev, "irq %u\n", irq); dev_dbg(dev->class_dev, "irq %u\n", irq);
/* allocate and initialize dev->private */ /* allocate and initialize dev->private */
if (alloc_private(dev, sizeof(struct das800_private)) < 0) if (alloc_private(dev, sizeof(struct das800_private)) < 0)
return -ENOMEM; return -ENOMEM;
if (iobase == 0) { if (iobase == 0) {
dev_err(dev->hw_dev, "io base address required for das800\n"); dev_err(dev->class_dev,
"io base address required for das800\n");
return -EINVAL; return -EINVAL;
} }
/* check if io addresses are available */ /* check if io addresses are available */
if (!request_region(iobase, DAS800_SIZE, "das800")) { if (!request_region(iobase, DAS800_SIZE, "das800")) {
dev_err(dev->hw_dev, "I/O port conflict\n"); dev_err(dev->class_dev, "I/O port conflict\n");
return -EIO; return -EIO;
} }
dev->iobase = iobase; dev->iobase = iobase;
board = das800_probe(dev); board = das800_probe(dev);
if (board < 0) { if (board < 0) {
dev_dbg(dev->hw_dev, "unable to determine board type\n"); dev_dbg(dev->class_dev, "unable to determine board type\n");
return -ENODEV; return -ENODEV;
} }
dev->board_ptr = das800_boards + board; dev->board_ptr = das800_boards + board;
/* grab our IRQ */ /* grab our IRQ */
if (irq == 1 || irq > 7) { if (irq == 1 || irq > 7) {
dev_err(dev->hw_dev, "irq out of range\n"); dev_err(dev->class_dev, "irq out of range\n");
return -EINVAL; return -EINVAL;
} }
if (irq) { if (irq) {
if (request_irq(irq, das800_interrupt, 0, "das800", dev)) { if (request_irq(irq, das800_interrupt, 0, "das800", dev)) {
dev_err(dev->hw_dev, "unable to allocate irq %u\n", dev_err(dev->class_dev, "unable to allocate irq %u\n",
irq); irq);
return -EINVAL; return -EINVAL;
} }
......
...@@ -289,7 +289,7 @@ static int dt3k_send_cmd(struct comedi_device *dev, unsigned int cmd) ...@@ -289,7 +289,7 @@ static int dt3k_send_cmd(struct comedi_device *dev, unsigned int cmd)
if ((status & DT3000_COMPLETION_MASK) == DT3000_NOERROR) if ((status & DT3000_COMPLETION_MASK) == DT3000_NOERROR)
return 0; return 0;
dev_dbg(dev->hw_dev, "dt3k_send_cmd() timeout/error status=0x%04x\n", dev_dbg(dev->class_dev, "dt3k_send_cmd() timeout/error status=0x%04x\n",
status); status);
return -ETIME; return -ETIME;
...@@ -390,7 +390,7 @@ static void dt3k_ai_empty_fifo(struct comedi_device *dev, ...@@ -390,7 +390,7 @@ static void dt3k_ai_empty_fifo(struct comedi_device *dev,
if (count < 0) if (count < 0)
count += AI_FIFO_DEPTH; count += AI_FIFO_DEPTH;
dev_dbg(dev->hw_dev, "reading %d samples\n", count); dev_dbg(dev->class_dev, "reading %d samples\n", count);
rear = devpriv->ai_rear; rear = devpriv->ai_rear;
...@@ -578,7 +578,7 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -578,7 +578,7 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
int ret; int ret;
unsigned int mode; unsigned int mode;
dev_dbg(dev->hw_dev, "dt3k_ai_cmd:\n"); dev_dbg(dev->class_dev, "dt3k_ai_cmd:\n");
for (i = 0; i < cmd->chanlist_len; i++) { for (i = 0; i < cmd->chanlist_len; i++) {
chan = CR_CHAN(cmd->chanlist[i]); chan = CR_CHAN(cmd->chanlist[i]);
range = CR_RANGE(cmd->chanlist[i]); range = CR_RANGE(cmd->chanlist[i]);
...@@ -589,15 +589,15 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -589,15 +589,15 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
aref = CR_AREF(cmd->chanlist[0]); aref = CR_AREF(cmd->chanlist[0]);
writew(cmd->scan_end_arg, devpriv->io_addr + DPR_Params(0)); writew(cmd->scan_end_arg, devpriv->io_addr + DPR_Params(0));
dev_dbg(dev->hw_dev, "param[0]=0x%04x\n", cmd->scan_end_arg); dev_dbg(dev->class_dev, "param[0]=0x%04x\n", cmd->scan_end_arg);
if (cmd->convert_src == TRIG_TIMER) { if (cmd->convert_src == TRIG_TIMER) {
divider = dt3k_ns_to_timer(50, &cmd->convert_arg, divider = dt3k_ns_to_timer(50, &cmd->convert_arg,
cmd->flags & TRIG_ROUND_MASK); cmd->flags & TRIG_ROUND_MASK);
writew((divider >> 16), devpriv->io_addr + DPR_Params(1)); writew((divider >> 16), devpriv->io_addr + DPR_Params(1));
dev_dbg(dev->hw_dev, "param[1]=0x%04x\n", divider >> 16); dev_dbg(dev->class_dev, "param[1]=0x%04x\n", divider >> 16);
writew((divider & 0xffff), devpriv->io_addr + DPR_Params(2)); writew((divider & 0xffff), devpriv->io_addr + DPR_Params(2));
dev_dbg(dev->hw_dev, "param[2]=0x%04x\n", divider & 0xffff); dev_dbg(dev->class_dev, "param[2]=0x%04x\n", divider & 0xffff);
} else { } else {
/* not supported */ /* not supported */
} }
...@@ -606,21 +606,21 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -606,21 +606,21 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
tscandiv = dt3k_ns_to_timer(100, &cmd->scan_begin_arg, tscandiv = dt3k_ns_to_timer(100, &cmd->scan_begin_arg,
cmd->flags & TRIG_ROUND_MASK); cmd->flags & TRIG_ROUND_MASK);
writew((tscandiv >> 16), devpriv->io_addr + DPR_Params(3)); writew((tscandiv >> 16), devpriv->io_addr + DPR_Params(3));
dev_dbg(dev->hw_dev, "param[3]=0x%04x\n", tscandiv >> 16); dev_dbg(dev->class_dev, "param[3]=0x%04x\n", tscandiv >> 16);
writew((tscandiv & 0xffff), devpriv->io_addr + DPR_Params(4)); writew((tscandiv & 0xffff), devpriv->io_addr + DPR_Params(4));
dev_dbg(dev->hw_dev, "param[4]=0x%04x\n", tscandiv & 0xffff); dev_dbg(dev->class_dev, "param[4]=0x%04x\n", tscandiv & 0xffff);
} else { } else {
/* not supported */ /* not supported */
} }
mode = DT3000_AD_RETRIG_INTERNAL | 0 | 0; mode = DT3000_AD_RETRIG_INTERNAL | 0 | 0;
writew(mode, devpriv->io_addr + DPR_Params(5)); writew(mode, devpriv->io_addr + DPR_Params(5));
dev_dbg(dev->hw_dev, "param[5]=0x%04x\n", mode); dev_dbg(dev->class_dev, "param[5]=0x%04x\n", mode);
writew(aref == AREF_DIFF, devpriv->io_addr + DPR_Params(6)); writew(aref == AREF_DIFF, devpriv->io_addr + DPR_Params(6));
dev_dbg(dev->hw_dev, "param[6]=0x%04x\n", aref == AREF_DIFF); dev_dbg(dev->class_dev, "param[6]=0x%04x\n", aref == AREF_DIFF);
writew(AI_FIFO_DEPTH / 2, devpriv->io_addr + DPR_Params(7)); writew(AI_FIFO_DEPTH / 2, devpriv->io_addr + DPR_Params(7));
dev_dbg(dev->hw_dev, "param[7]=0x%04x\n", AI_FIFO_DEPTH / 2); dev_dbg(dev->class_dev, "param[7]=0x%04x\n", AI_FIFO_DEPTH / 2);
writew(SUBS_AI, devpriv->io_addr + DPR_SubSys); writew(SUBS_AI, devpriv->io_addr + DPR_SubSys);
ret = dt3k_send_cmd(dev, CMD_CONFIG); ret = dt3k_send_cmd(dev, CMD_CONFIG);
...@@ -856,7 +856,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -856,7 +856,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
int bus, slot; int bus, slot;
int ret = 0; int ret = 0;
dev_dbg(dev->hw_dev, "dt3000:\n"); dev_dbg(dev->class_dev, "dt3000:\n");
bus = it->options[0]; bus = it->options[0];
slot = it->options[1]; slot = it->options[1];
...@@ -868,7 +868,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -868,7 +868,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (ret < 0) if (ret < 0)
return ret; return ret;
if (ret == 0) { if (ret == 0) {
dev_warn(dev->hw_dev, "no DT board found\n"); dev_warn(dev->class_dev, "no DT board found\n");
return -ENODEV; return -ENODEV;
} }
...@@ -876,7 +876,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -876,7 +876,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (request_irq(devpriv->pci_dev->irq, dt3k_interrupt, IRQF_SHARED, if (request_irq(devpriv->pci_dev->irq, dt3k_interrupt, IRQF_SHARED,
"dt3000", dev)) { "dt3000", dev)) {
dev_err(dev->hw_dev, "unable to allocate IRQ %u\n", dev_err(dev->class_dev, "unable to allocate IRQ %u\n",
devpriv->pci_dev->irq); devpriv->pci_dev->irq);
return -EINVAL; return -EINVAL;
} }
......
...@@ -349,13 +349,13 @@ static int jr3_pci_open(struct comedi_device *dev) ...@@ -349,13 +349,13 @@ static int jr3_pci_open(struct comedi_device *dev)
int i; int i;
struct jr3_pci_dev_private *devpriv = dev->private; struct jr3_pci_dev_private *devpriv = dev->private;
dev_dbg(dev->hw_dev, "jr3_pci_open\n"); dev_dbg(dev->class_dev, "jr3_pci_open\n");
for (i = 0; i < devpriv->n_channels; i++) { for (i = 0; i < devpriv->n_channels; i++) {
struct jr3_pci_subdev_private *p; struct jr3_pci_subdev_private *p;
p = dev->subdevices[i].private; p = dev->subdevices[i].private;
if (p) { if (p) {
dev_dbg(dev->hw_dev, "serial: %p %d (%d)\n", p, dev_dbg(dev->class_dev, "serial: %p %d (%d)\n", p,
p->serial_no, p->channel_no); p->serial_no, p->channel_no);
} }
} }
...@@ -434,7 +434,8 @@ static int jr3_download_firmware(struct comedi_device *dev, const u8 * data, ...@@ -434,7 +434,8 @@ static int jr3_download_firmware(struct comedi_device *dev, const u8 * data,
break; break;
more = more more = more
&& read_idm_word(data, size, &pos, &addr); && read_idm_word(data, size, &pos, &addr);
dev_dbg(dev->hw_dev, "Loading#%d %4.4x bytes at %4.4x\n", dev_dbg(dev->class_dev,
"Loading#%d %4.4x bytes at %4.4x\n",
i, count, addr); i, count, addr);
while (more && count > 0) { while (more && count > 0) {
if (addr & 0x4000) { if (addr & 0x4000) {
...@@ -754,7 +755,8 @@ static int jr3_pci_attach(struct comedi_device *dev, ...@@ -754,7 +755,8 @@ static int jr3_pci_attach(struct comedi_device *dev,
opt_slot = it->options[1]; opt_slot = it->options[1];
if (sizeof(struct jr3_channel) != 0xc00) { if (sizeof(struct jr3_channel) != 0xc00) {
dev_err(dev->hw_dev, "sizeof(struct jr3_channel) = %x [expected %x]\n", dev_err(dev->class_dev,
"sizeof(struct jr3_channel) = %x [expected %x]\n",
(unsigned)sizeof(struct jr3_channel), 0xc00); (unsigned)sizeof(struct jr3_channel), 0xc00);
return -EINVAL; return -EINVAL;
} }
...@@ -809,7 +811,7 @@ static int jr3_pci_attach(struct comedi_device *dev, ...@@ -809,7 +811,7 @@ static int jr3_pci_attach(struct comedi_device *dev,
} }
} }
if (!card) { if (!card) {
dev_err(dev->hw_dev, "no jr3_pci found\n"); dev_err(dev->class_dev, "no jr3_pci found\n");
return -EIO; return -EIO;
} else { } else {
devpriv->pci_dev = card; devpriv->pci_dev = card;
...@@ -844,7 +846,7 @@ static int jr3_pci_attach(struct comedi_device *dev, ...@@ -844,7 +846,7 @@ static int jr3_pci_attach(struct comedi_device *dev,
p = dev->subdevices[i].private; p = dev->subdevices[i].private;
p->channel = &devpriv->iobase->channel[i].data; p->channel = &devpriv->iobase->channel[i].data;
dev_dbg(dev->hw_dev, "p->channel %p %p (%tx)\n", dev_dbg(dev->class_dev, "p->channel %p %p (%tx)\n",
p->channel, devpriv->iobase, p->channel, devpriv->iobase,
((char *)(p->channel) - ((char *)(p->channel) -
(char *)(devpriv->iobase))); (char *)(devpriv->iobase)));
...@@ -885,7 +887,7 @@ static int jr3_pci_attach(struct comedi_device *dev, ...@@ -885,7 +887,7 @@ static int jr3_pci_attach(struct comedi_device *dev,
devpriv->iobase->channel[0].reset = 0; devpriv->iobase->channel[0].reset = 0;
result = comedi_load_firmware(dev, "jr3pci.idm", jr3_download_firmware); result = comedi_load_firmware(dev, "jr3pci.idm", jr3_download_firmware);
dev_dbg(dev->hw_dev, "Firmare load %d\n", result); dev_dbg(dev->class_dev, "Firmare load %d\n", result);
if (result < 0) if (result < 0)
goto out; goto out;
...@@ -903,7 +905,7 @@ static int jr3_pci_attach(struct comedi_device *dev, ...@@ -903,7 +905,7 @@ static int jr3_pci_attach(struct comedi_device *dev,
*/ */
msleep_interruptible(25); msleep_interruptible(25);
for (i = 0; i < 0x18; i++) { for (i = 0; i < 0x18; i++) {
dev_dbg(dev->hw_dev, "%c\n", dev_dbg(dev->class_dev, "%c\n",
get_u16(&devpriv->iobase->channel[0]. get_u16(&devpriv->iobase->channel[0].
data.copyright[i]) >> 8); data.copyright[i]) >> 8);
} }
......
...@@ -1593,7 +1593,7 @@ static int pcimio_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1593,7 +1593,7 @@ static int pcimio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{ {
int ret; int ret;
dev_info(dev->hw_dev, "comedi%d: ni_pcimio:\n", dev->minor); dev_info(dev->class_dev, "ni_pcimio: attach\n");
ret = ni_alloc_private(dev); ret = ni_alloc_private(dev);
if (ret < 0) if (ret < 0)
...@@ -1603,7 +1603,7 @@ static int pcimio_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1603,7 +1603,7 @@ static int pcimio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (ret < 0) if (ret < 0)
return ret; return ret;
dev_dbg(dev->hw_dev, "%s\n", boardtype.name); dev_dbg(dev->class_dev, "%s\n", boardtype.name);
dev->board_name = boardtype.name; dev->board_name = boardtype.name;
if (boardtype.reg_type & ni_reg_m_series_mask) { if (boardtype.reg_type & ni_reg_m_series_mask) {
......
...@@ -952,7 +952,7 @@ static int pcl818_ai_cmd_mode(int mode, struct comedi_device *dev, ...@@ -952,7 +952,7 @@ static int pcl818_ai_cmd_mode(int mode, struct comedi_device *dev,
int divisor1 = 0, divisor2 = 0; int divisor1 = 0, divisor2 = 0;
unsigned int seglen; unsigned int seglen;
dev_dbg(dev->hw_dev, "pcl818_ai_cmd_mode()\n"); dev_dbg(dev->class_dev, "pcl818_ai_cmd_mode()\n");
if ((!dev->irq) && (!devpriv->dma_rtc)) { if ((!dev->irq) && (!devpriv->dma_rtc)) {
comedi_error(dev, "IRQ not defined!"); comedi_error(dev, "IRQ not defined!");
return -EINVAL; return -EINVAL;
...@@ -1055,7 +1055,7 @@ static int pcl818_ai_cmd_mode(int mode, struct comedi_device *dev, ...@@ -1055,7 +1055,7 @@ static int pcl818_ai_cmd_mode(int mode, struct comedi_device *dev,
break; break;
} }
#endif #endif
dev_dbg(dev->hw_dev, "pcl818_ai_cmd_mode() end\n"); dev_dbg(dev->class_dev, "pcl818_ai_cmd_mode() end\n");
return 0; return 0;
} }
...@@ -1386,7 +1386,7 @@ static int ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -1386,7 +1386,7 @@ static int ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
struct comedi_cmd *cmd = &s->async->cmd; struct comedi_cmd *cmd = &s->async->cmd;
int retval; int retval;
dev_dbg(dev->hw_dev, "pcl818_ai_cmd()\n"); dev_dbg(dev->class_dev, "pcl818_ai_cmd()\n");
devpriv->ai_n_chan = cmd->chanlist_len; devpriv->ai_n_chan = cmd->chanlist_len;
devpriv->ai_chanlist = cmd->chanlist; devpriv->ai_chanlist = cmd->chanlist;
devpriv->ai_flags = cmd->flags; devpriv->ai_flags = cmd->flags;
...@@ -1404,7 +1404,7 @@ static int ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -1404,7 +1404,7 @@ static int ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
if (cmd->convert_src == TRIG_TIMER) { /* mode 1 */ if (cmd->convert_src == TRIG_TIMER) { /* mode 1 */
devpriv->ai_timer1 = cmd->convert_arg; devpriv->ai_timer1 = cmd->convert_arg;
retval = pcl818_ai_cmd_mode(1, dev, s); retval = pcl818_ai_cmd_mode(1, dev, s);
dev_dbg(dev->hw_dev, "pcl818_ai_cmd() end\n"); dev_dbg(dev->class_dev, "pcl818_ai_cmd() end\n");
return retval; return retval;
} }
if (cmd->convert_src == TRIG_EXT) { /* mode 3 */ if (cmd->convert_src == TRIG_EXT) { /* mode 3 */
...@@ -1423,7 +1423,7 @@ static int pcl818_ai_cancel(struct comedi_device *dev, ...@@ -1423,7 +1423,7 @@ static int pcl818_ai_cancel(struct comedi_device *dev,
struct comedi_subdevice *s) struct comedi_subdevice *s)
{ {
if (devpriv->irq_blocked > 0) { if (devpriv->irq_blocked > 0) {
dev_dbg(dev->hw_dev, "pcl818_ai_cancel()\n"); dev_dbg(dev->class_dev, "pcl818_ai_cancel()\n");
devpriv->irq_was_now_closed = 1; devpriv->irq_was_now_closed = 1;
switch (devpriv->ai_mode) { switch (devpriv->ai_mode) {
...@@ -1473,7 +1473,7 @@ static int pcl818_ai_cancel(struct comedi_device *dev, ...@@ -1473,7 +1473,7 @@ static int pcl818_ai_cancel(struct comedi_device *dev,
} }
end: end:
dev_dbg(dev->hw_dev, "pcl818_ai_cancel() end\n"); dev_dbg(dev->class_dev, "pcl818_ai_cancel() end\n");
return 0; return 0;
} }
......
...@@ -227,7 +227,7 @@ static int pcmuio_dio_insn_bits(struct comedi_device *dev, ...@@ -227,7 +227,7 @@ static int pcmuio_dio_insn_bits(struct comedi_device *dev,
#ifdef DAMMIT_ITS_BROKEN #ifdef DAMMIT_ITS_BROKEN
/* DEBUG */ /* DEBUG */
dev_dbg(dev->hw_dev, "write mask: %08x data: %08x\n", data[0], dev_dbg(dev->class_dev, "write mask: %08x data: %08x\n", data[0],
data[1]); data[1]);
#endif #endif
...@@ -264,7 +264,7 @@ static int pcmuio_dio_insn_bits(struct comedi_device *dev, ...@@ -264,7 +264,7 @@ static int pcmuio_dio_insn_bits(struct comedi_device *dev,
} }
#ifdef DAMMIT_ITS_BROKEN #ifdef DAMMIT_ITS_BROKEN
/* DEBUG */ /* DEBUG */
dev_dbg(dev->hw_dev, "data_out_byte %02x\n", (unsigned)byte); dev_dbg(dev->class_dev, "data_out_byte %02x\n", (unsigned)byte);
#endif #endif
/* save the digital input lines for this byte.. */ /* save the digital input lines for this byte.. */
s->state |= ((unsigned int)byte) << offset; s->state |= ((unsigned int)byte) << offset;
...@@ -275,7 +275,7 @@ static int pcmuio_dio_insn_bits(struct comedi_device *dev, ...@@ -275,7 +275,7 @@ static int pcmuio_dio_insn_bits(struct comedi_device *dev,
#ifdef DAMMIT_ITS_BROKEN #ifdef DAMMIT_ITS_BROKEN
/* DEBUG */ /* DEBUG */
dev_dbg(dev->hw_dev, "s->state %08x data_out %08x\n", s->state, dev_dbg(dev->class_dev, "s->state %08x data_out %08x\n", s->state,
data[1]); data[1]);
#endif #endif
...@@ -760,7 +760,7 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -760,7 +760,7 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
irq[0] = it->options[1]; irq[0] = it->options[1];
irq[1] = it->options[2]; irq[1] = it->options[2];
dev_dbg(dev->hw_dev, "comedi%d: %s: io: %lx attached\n", dev->minor, dev_dbg(dev->class_dev, "%s: io: %lx attach\n",
dev->driver->driver_name, iobase); dev->driver->driver_name, iobase);
dev->iobase = iobase; dev->iobase = iobase;
...@@ -768,7 +768,7 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -768,7 +768,7 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (!iobase || !request_region(iobase, if (!iobase || !request_region(iobase,
board->num_asics * ASIC_IOSIZE, board->num_asics * ASIC_IOSIZE,
dev->driver->driver_name)) { dev->driver->driver_name)) {
dev_err(dev->hw_dev, "I/O port conflict\n"); dev_err(dev->class_dev, "I/O port conflict\n");
return -EIO; return -EIO;
} }
...@@ -779,7 +779,8 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -779,7 +779,8 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
* convenient macro defined in comedidev.h. * convenient macro defined in comedidev.h.
*/ */
if (alloc_private(dev, sizeof(struct pcmuio_private)) < 0) { if (alloc_private(dev, sizeof(struct pcmuio_private)) < 0) {
dev_warn(dev->hw_dev, "cannot allocate private data structure\n"); dev_warn(dev->class_dev,
"cannot allocate private data structure\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -798,7 +799,8 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -798,7 +799,8 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
kcalloc(n_subdevs, sizeof(struct pcmuio_subdev_private), kcalloc(n_subdevs, sizeof(struct pcmuio_subdev_private),
GFP_KERNEL); GFP_KERNEL);
if (!devpriv->sprivs) { if (!devpriv->sprivs) {
dev_warn(dev->hw_dev, "cannot allocate subdevice private data structures\n"); dev_warn(dev->class_dev,
"cannot allocate subdevice private data structures\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -890,11 +892,12 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -890,11 +892,12 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
irqs.. */ irqs.. */
if (irq[0]) { if (irq[0]) {
dev_dbg(dev->hw_dev, "irq: %u\n", irq[0]); dev_dbg(dev->class_dev, "irq: %u\n", irq[0]);
if (irq[1] && board->num_asics == 2) if (irq[1] && board->num_asics == 2)
dev_dbg(dev->hw_dev, "second ASIC irq: %u\n", irq[1]); dev_dbg(dev->class_dev, "second ASIC irq: %u\n",
irq[1]);
} else { } else {
dev_dbg(dev->hw_dev, "(IRQ mode disabled)\n"); dev_dbg(dev->class_dev, "(IRQ mode disabled)\n");
} }
......
...@@ -782,7 +782,7 @@ static int serial2002_attach(struct comedi_device *dev, ...@@ -782,7 +782,7 @@ static int serial2002_attach(struct comedi_device *dev,
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret; int ret;
dev_dbg(dev->hw_dev, "comedi%d: attached\n", dev->minor); dev_dbg(dev->class_dev, "serial2002: attach\n");
dev->board_name = board->name; dev->board_name = board->name;
if (alloc_private(dev, sizeof(struct serial2002_private)) < 0) if (alloc_private(dev, sizeof(struct serial2002_private)) < 0)
return -ENOMEM; return -ENOMEM;
...@@ -790,7 +790,7 @@ static int serial2002_attach(struct comedi_device *dev, ...@@ -790,7 +790,7 @@ static int serial2002_attach(struct comedi_device *dev,
dev->close = serial_2002_close; dev->close = serial_2002_close;
devpriv->port = it->options[0]; devpriv->port = it->options[0];
devpriv->speed = it->options[1]; devpriv->speed = it->options[1];
dev_dbg(dev->hw_dev, "/dev/ttyS%d @ %d\n", devpriv->port, dev_dbg(dev->class_dev, "/dev/ttyS%d @ %d\n", devpriv->port,
devpriv->speed); devpriv->speed);
ret = comedi_alloc_subdevices(dev, 5); ret = comedi_alloc_subdevices(dev, 5);
......
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