Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317401
b: refs/heads/master
c: f41ad66
h: refs/heads/master
i:
  317399: 5f2fe55
v: v3
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Jun 19, 2012
1 parent a88590d commit 8c9c7eb
Show file tree
Hide file tree
Showing 21 changed files with 188 additions and 161 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4ea418b8b2fa8a70d0fcc8231b65e67b3a72984b
refs/heads/master: f41ad6675f2d5705a0fc1e210af8eb4a27dbacb4
17 changes: 9 additions & 8 deletions trunk/drivers/staging/comedi/drivers/adv_pci1710.c
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ static int pci1710_attach(struct comedi_device *dev,
int i;
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_slot = it->options[1];
Expand Down Expand Up @@ -1399,10 +1399,10 @@ static int pci1710_attach(struct comedi_device *dev,

if (!pcidev) {
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);
} else {
dev_err(dev->hw_dev, "- Card %s\n", errstr);
dev_err(dev->class_dev, "- Card %s\n", errstr);
}
return -EIO;
}
Expand All @@ -1413,8 +1413,8 @@ static int pci1710_attach(struct comedi_device *dev,
irq = pcidev->irq;
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,
pci_func, iobase);
dev_dbg(dev->class_dev, "b:s:f=%d:%d:%d, io=0x%4lx\n",
pci_bus, pci_slot, pci_func, iobase);

dev->iobase = iobase;

Expand Down Expand Up @@ -1444,14 +1444,15 @@ static int pci1710_attach(struct comedi_device *dev,
if (request_irq(irq, interrupt_service_pci1710,
IRQF_SHARED, "Advantech PCI-1710",
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 = 0; /* Can't use IRQ */
} else {
dev_dbg(dev->hw_dev, "irq=%u", irq);
dev_dbg(dev->class_dev, "irq=%u", irq);
}
} else {
dev_dbg(dev->hw_dev, "IRQ disabled");
dev_dbg(dev->class_dev, "IRQ disabled");
}
} else {
irq = 0;
Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/staging/comedi/drivers/adv_pci_dio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,16 +1121,18 @@ static int pci_dio_attach(struct comedi_device *dev,
}

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;
}

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;
}
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),
PCI_FUNC(pcidev->devfn), iobase);

Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/staging/comedi/drivers/cb_das16_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static const struct das16cs_board *das16cs_probe(struct comedi_device *dev,
return das16cs_boards + i;
}

dev_dbg(dev->hw_dev, "unknown board!\n");
dev_dbg(dev->class_dev, "unknown board!\n");

return NULL;
}
Expand All @@ -163,18 +163,18 @@ static int das16cs_attach(struct comedi_device *dev,
int ret;
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 */
if (!link)
return -EIO;

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)
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,
Expand All @@ -184,7 +184,7 @@ static int das16cs_attach(struct comedi_device *dev,

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);
if (!dev->board_ptr)
Expand Down Expand Up @@ -306,7 +306,7 @@ static int das16cs_ai_rinsn(struct comedi_device *dev,
break;
}
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;
}
data[i] = (unsigned short)inw(dev->iobase + 0);
Expand Down
26 changes: 14 additions & 12 deletions trunk/drivers/staging/comedi/drivers/cb_pcidas.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,20 +567,22 @@ 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;

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,
PCI_SLOT(pcidev->devfn));

/*
* Enable PCI device and reserve I/O ports.
*/
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;
}
/*
Expand All @@ -606,7 +608,7 @@ static int cb_pcidas_attach(struct comedi_device *dev,
/* get irq */
if (request_irq(devpriv->pci_dev->irq, cb_pcidas_interrupt,
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);
return -EINVAL;
}
Expand Down Expand Up @@ -807,7 +809,7 @@ static int ai_config_calibration_source(struct comedi_device *dev,
unsigned int source = data[1];

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);
return -EINVAL;
}
Expand Down Expand Up @@ -1229,7 +1231,7 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
outw(bits, devpriv->control_status + ADCMUX_CONT);

#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

/* load counters */
Expand All @@ -1256,7 +1258,7 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
devpriv->adc_fifo_bits |= INT_FHF; /* interrupt fifo half full */
}
#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);
#endif
/* enable (and clear) interrupts */
Expand All @@ -1283,7 +1285,7 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
bits |= BURSTE;
outw(bits, devpriv->control_status + TRIG_CONTSTAT);
#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

return 0;
Expand Down Expand Up @@ -1500,7 +1502,7 @@ static int cb_pcidas_ao_inttrig(struct comedi_device *dev,
spin_lock_irqsave(&dev->spinlock, flags);
devpriv->adc_fifo_bits |= DAEMIE | DAHFIE;
#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);
#endif
/* enable and clear interrupts */
Expand All @@ -1511,7 +1513,7 @@ static int cb_pcidas_ao_inttrig(struct comedi_device *dev,
devpriv->ao_control_bits |= DAC_START | DACEN | DAC_EMPTY;
outw(devpriv->ao_control_bits, devpriv->control_status + DAC_CSR);
#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);
#endif
spin_unlock_irqrestore(&dev->spinlock, flags);
Expand Down Expand Up @@ -1540,8 +1542,8 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d)

s5933_status = inl(devpriv->s5933_config + AMCC_OP_REG_INTCSR);
#ifdef CB_PCIDAS_DEBUG
dev_dbg(dev->hw_dev, "intcsr 0x%x\n", s5933_status);
dev_dbg(dev->hw_dev, "mbef 0x%x\n",
dev_dbg(dev->class_dev, "intcsr 0x%x\n", s5933_status);
dev_dbg(dev->class_dev, "mbef 0x%x\n",
inl(devpriv->s5933_config + AMCC_OP_REG_MBEF));
#endif

Expand Down
20 changes: 11 additions & 9 deletions trunk/drivers/staging/comedi/drivers/cb_pcidas64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1701,11 +1701,12 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
return -EIO;
}

dev_dbg(dev->hw_dev, "Found %s on bus %i, slot %i\n", board(dev)->name,
pcidev->bus->number, PCI_SLOT(pcidev->devfn));
dev_dbg(dev->class_dev, "Found %s on bus %i, slot %i\n",
board(dev)->name, pcidev->bus->number, PCI_SLOT(pcidev->devfn));

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;
}
pci_set_master(pcidev);
Expand Down Expand Up @@ -1733,7 +1734,7 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)

if (!priv(dev)->plx9080_iobase || !priv(dev)->main_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;
}

Expand Down Expand Up @@ -1769,19 +1770,19 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)

priv(dev)->hw_revision =
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);
init_plx9080(dev);
init_stc_registers(dev);
/* get irq */
if (request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
"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);
return -EINVAL;
}
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);
if (retval < 0)
Expand Down Expand Up @@ -2002,7 +2003,7 @@ static int ai_config_calibration_source(struct comedi_device *dev,
else
num_calibration_sources = 8;
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);
return -EINVAL;
}
Expand Down Expand Up @@ -2834,7 +2835,8 @@ static void pio_drain_ai_fifo_16(struct comedi_device *dev)
}

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;
}

Expand Down
12 changes: 7 additions & 5 deletions trunk/drivers/staging/comedi/drivers/cb_pcidda.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,21 +294,23 @@ static int cb_pcidda_attach(struct comedi_device *dev,
}
}
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;
}
found:
devpriv->pci_dev = pcidev;
dev->board_ptr = cb_pcidda_boards + index;
/* "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);

/*
* Enable PCI device and request regions.
*/
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;
}

Expand Down Expand Up @@ -356,10 +358,10 @@ static int cb_pcidda_attach(struct comedi_device *dev,
s = dev->subdevices + 2;
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++) {
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]);
}

Expand Down
9 changes: 5 additions & 4 deletions trunk/drivers/staging/comedi/drivers/cb_pcidio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

found:
Expand All @@ -167,8 +168,8 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
dev->board_name = thisboard->name;

devpriv->pci_dev = pcidev;
dev_dbg(dev->hw_dev, "Found %s on bus %i, slot %i\n", thisboard->name,
devpriv->pci_dev->bus->number,
dev_dbg(dev->class_dev, "Found %s on bus %i, slot %i\n",
thisboard->name, devpriv->pci_dev->bus->number,
PCI_SLOT(devpriv->pci_dev->devfn));
if (comedi_pci_enable(pcidev, thisboard->name))
return -EIO;
Expand All @@ -185,7 +186,7 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
for (i = 0; i < thisboard->n_8255; i++) {
subdev_8255_init(dev, dev->subdevices + i,
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);
}

Expand Down
Loading

0 comments on commit 8c9c7eb

Please sign in to comment.