retval = tms9914_read(board, tms_priv, buffer, 1, end, &num_bytes);
*bytes_read += num_bytes;
if (retval < 0)
- pr_err("%s: tms9914_read failed retval=%i\n", driver_name, retval);
+ dev_err(board->gpib_dev, "%s: tms9914_read failed retval=%i\n",
+ driver_name, retval);
if (retval < 0 || *end)
return retval;
++buffer;
test_bit(DEV_CLEAR_BN, &tms_priv->state) ||
test_bit(TIMO_NUM, &board->status));
if (retval) {
- pr_err("%s: read wait interrupted\n", driver_name);
+ dev_dbg(board->gpib_dev, "%s: read wait interrupted\n", driver_name);
retval = -ERESTARTSYS;
break;
}
*end = 1;
}
if (test_bit(TIMO_NUM, &board->status)) {
- pr_err("%s: minor %i: read timed out\n", driver_name, board->minor);
+ dev_err(board->gpib_dev, "%s: read timed out\n", driver_name);
retval = -ETIMEDOUT;
break;
}
if (test_bit(DEV_CLEAR_BN, &tms_priv->state)) {
- pr_err("%s: device clear interrupted read\n", driver_name);
+ dev_err(board->gpib_dev, "%s: device clear interrupted read\n",
+ driver_name);
retval = -EINTR;
break;
}
struct tms9914_priv *tms_priv = &a_priv->tms9914_priv;
if (retval) {
- pr_err("%s: write wait interrupted\n", driver_name);
+ dev_err(board->gpib_dev, "%s: write wait interrupted\n", driver_name);
return -ERESTARTSYS;
}
if (test_bit(TIMO_NUM, &board->status)) {
- pr_err("%s: minor %i: write timed out\n", driver_name, board->minor);
+ dev_err(board->gpib_dev, "%s: write timed out\n", driver_name);
return -ETIMEDOUT;
}
if (test_bit(DEV_CLEAR_BN, &tms_priv->state)) {
- pr_err("%s: device clear interrupted write\n", driver_name);
+ dev_err(board->gpib_dev, "%s: device clear interrupted write\n", driver_name);
return -EINTR;
}
return 0;
return 0;
// need to programme borg
if (!config->init_data || config->init_data_length != firmware_length) {
- pr_err("%s: the 82350A board requires firmware after powering on.\n", driver_name);
+ dev_err(board->gpib_dev, "%s: the 82350A board requires firmware after powering on.\n",
+ driver_name);
return -EIO;
}
- pr_info("%s: Loading firmware...\n", driver_name);
+ dev_info(board->gpib_dev, "%s: Loading firmware...\n", driver_name);
// tickle the borg
writel(plx_cntrl_static_bits | PLX9050_USER3_DATA_BIT,
usleep_range(10, 20);
}
if (j == timeout) {
- pr_err("%s: timed out loading firmware.\n", driver_name);
+ dev_err(board->gpib_dev, "%s: timed out loading firmware.\n", driver_name);
return -ETIMEDOUT;
}
writeb(firmware_data[i], a_priv->gpib_base + CONFIG_DATA_REG);
usleep_range(10, 20);
}
if (j == timeout) {
- pr_err("%s: timed out waiting for firmware load to complete.\n", driver_name);
+ dev_err(board->gpib_dev, "%s: timed out waiting for firmware load to complete.\n",
+ driver_name);
return -ETIMEDOUT;
}
- pr_info("%s: ...done.\n", driver_name);
+ dev_info(board->gpib_dev, "%s: ...done.\n", driver_name);
return 0;
}
unsigned int read_value = readb(a_priv->sram_base + i);
if ((i & byte_mask) != read_value) {
- pr_err("%s: SRAM test failed at %d wanted %d got %d\n",
- driver_name, i, (i & byte_mask), read_value);
+ dev_err(board->gpib_dev, "%s: SRAM test failed at %d wanted %d got %d\n",
+ driver_name, i, (i & byte_mask), read_value);
return -EIO;
}
if (need_resched())
schedule();
}
- pr_info("%s: SRAM test passed 0x%x bytes checked\n", driver_name, sram_length);
+ dev_info(board->gpib_dev, "%s: SRAM test passed 0x%x bytes checked\n",
+ driver_name, sram_length);
return 0;
}
PCI_DEVICE_ID_82350B, NULL);
if (a_priv->pci_device) {
a_priv->model = MODEL_82350B;
- pr_info("%s: Agilent 82350B board found\n", driver_name);
+ dev_info(board->gpib_dev, "%s: Agilent 82350B board found\n", driver_name);
} else {
a_priv->pci_device = gpib_pci_get_device(config, PCI_VENDOR_ID_AGILENT,
PCI_DEVICE_ID_82351A, NULL);
if (a_priv->pci_device) {
a_priv->model = MODEL_82351A;
- pr_info("%s: Agilent 82351B board found\n", driver_name);
+ dev_info(board->gpib_dev, "%s: Agilent 82351B board found\n", driver_name);
} else {
a_priv->pci_device = gpib_pci_get_subsys(config, PCI_VENDOR_ID_PLX,
a_priv->pci_device);
if (a_priv->pci_device) {
a_priv->model = MODEL_82350A;
- pr_info("%s: HP/Agilent 82350A board found\n", driver_name);
+ dev_info(board->gpib_dev, "%s: HP/Agilent 82350A board found\n",
+ driver_name);
} else {
- pr_err("%s: no 82350/82351 board found\n", driver_name);
+ dev_err(board->gpib_dev, "%s: no 82350/82351 board found\n",
+ driver_name);
return -ENODEV;
}
}
}
if (pci_enable_device(a_priv->pci_device)) {
- pr_err("%s: error enabling pci device\n", driver_name);
+ dev_err(board->gpib_dev, "%s: error enabling pci device\n", driver_name);
return -EIO;
}
if (pci_request_regions(a_priv->pci_device, driver_name))
case MODEL_82350A:
a_priv->plx_base = ioremap(pci_resource_start(a_priv->pci_device, PLX_MEM_REGION),
pci_resource_len(a_priv->pci_device, PLX_MEM_REGION));
- pr_info("%s: plx base address remapped to 0x%p\n", driver_name, a_priv->plx_base);
+ dev_dbg(board->gpib_dev, "%s: plx base address remapped to 0x%p\n",
+ driver_name, a_priv->plx_base);
a_priv->gpib_base = ioremap(pci_resource_start(a_priv->pci_device,
GPIB_82350A_REGION),
pci_resource_len(a_priv->pci_device,
GPIB_82350A_REGION));
- pr_info("%s: gpib base address remapped to 0x%p\n", driver_name, a_priv->gpib_base);
+ dev_dbg(board->gpib_dev, "%s: gpib base address remapped to 0x%p\n",
+ driver_name, a_priv->gpib_base);
tms_priv->iobase = a_priv->gpib_base + TMS9914_BASE_REG;
a_priv->sram_base = ioremap(pci_resource_start(a_priv->pci_device,
SRAM_82350A_REGION),
pci_resource_len(a_priv->pci_device,
SRAM_82350A_REGION));
- pr_info("%s: sram base address remapped to 0x%p\n", driver_name, a_priv->sram_base);
+ dev_dbg(board->gpib_dev, "%s: sram base address remapped to 0x%p\n",
+ driver_name, a_priv->sram_base);
a_priv->borg_base = ioremap(pci_resource_start(a_priv->pci_device,
BORG_82350A_REGION),
pci_resource_len(a_priv->pci_device,
BORG_82350A_REGION));
- pr_info("%s: borg base address remapped to 0x%p\n", driver_name, a_priv->borg_base);
+ dev_dbg(board->gpib_dev, "%s: borg base address remapped to 0x%p\n",
+ driver_name, a_priv->borg_base);
retval = init_82350a_hardware(board, config);
if (retval < 0)
case MODEL_82351A:
a_priv->gpib_base = ioremap(pci_resource_start(a_priv->pci_device, GPIB_REGION),
pci_resource_len(a_priv->pci_device, GPIB_REGION));
- pr_info("%s: gpib base address remapped to 0x%p\n", driver_name, a_priv->gpib_base);
+ dev_dbg(board->gpib_dev, "%s: gpib base address remapped to 0x%p\n",
+ driver_name, a_priv->gpib_base);
tms_priv->iobase = a_priv->gpib_base + TMS9914_BASE_REG;
a_priv->sram_base = ioremap(pci_resource_start(a_priv->pci_device, SRAM_REGION),
pci_resource_len(a_priv->pci_device, SRAM_REGION));
- pr_info("%s: sram base address remapped to 0x%p\n", driver_name, a_priv->sram_base);
+ dev_dbg(board->gpib_dev, "%s: sram base address remapped to 0x%p\n",
+ driver_name, a_priv->sram_base);
a_priv->misc_base = ioremap(pci_resource_start(a_priv->pci_device, MISC_REGION),
pci_resource_len(a_priv->pci_device, MISC_REGION));
- pr_info("%s: misc base address remapped to 0x%p\n", driver_name, a_priv->misc_base);
+ dev_dbg(board->gpib_dev, "%s: misc base address remapped to 0x%p\n",
+ driver_name, a_priv->misc_base);
break;
default:
pr_err("%s: invalid board\n", driver_name);
return -EIO;
}
a_priv->irq = a_priv->pci_device->irq;
- pr_info("%s: IRQ %d\n", driver_name, a_priv->irq);
+ dev_dbg(board->gpib_dev, "%s: IRQ %d\n", driver_name, a_priv->irq);
writeb(0, a_priv->gpib_base + SRAM_ACCESS_CONTROL_REG);
a_priv->card_mode_bits = ENABLE_PCI_IRQ_BIT;