short ai_bounce_buffer[2 * PCI9111_FIFO_HALF_SIZE];
};
-#define dev_private ((struct pci9111_private_data *)dev->private)
-
/* ------------------------------------------------------------------ */
/* PLX9050 SECTION */
/* ------------------------------------------------------------------ */
static void pci9111_timer_set(struct comedi_device *dev)
{
+ struct pci9111_private_data *dev_private = dev->private;
+
pci9111_8254_control_set(PCI9111_8254_COUNTER_0 |
PCI9111_8254_READ_LOAD_LSB_MSB |
PCI9111_8254_MODE_0 |
static int pci9111_ai_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{
+ struct pci9111_private_data *dev_private = dev->private;
+
/* Disable interrupts */
plx9050_interrupt_control(dev_private->lcr_io_base, true, true, true,
pci9111_ai_do_cmd_test(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_cmd *cmd)
{
+ struct pci9111_private_data *dev_private = dev->private;
int tmp;
int error = 0;
int range, reference;
static int pci9111_ai_do_cmd(struct comedi_device *dev,
struct comedi_subdevice *s)
{
+ struct pci9111_private_data *dev_private = dev->private;
struct comedi_cmd *async_cmd = &s->async->cmd;
if (!dev->irq) {
static irqreturn_t pci9111_interrupt(int irq, void *p_device)
{
struct comedi_device *dev = p_device;
+ struct pci9111_private_data *dev_private = dev->private;
struct comedi_subdevice *s = dev->read_subdev;
struct comedi_async *async;
unsigned long irq_flags;
struct comedi_subdevice *s, struct comedi_insn *insn,
unsigned int *data)
{
+ struct pci9111_private_data *dev_private = dev->private;
int i;
for (i = 0; i < insn->n; i++) {
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
+ struct pci9111_private_data *dev_private = dev->private;
int i;
for (i = 0; i < insn->n; i++)
static int pci9111_reset(struct comedi_device *dev)
{
+ struct pci9111_private_data *dev_private = dev->private;
+
/* Set trigger source to software */
plx9050_interrupt_control(dev_private->lcr_io_base, true, true, true,
static int pci9111_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
+ struct pci9111_private_data *dev_private;
struct pci_dev *pcidev;
struct comedi_subdevice *s;
unsigned long io_base, io_range, lcr_io_base, lcr_io_range;
- int error;
+ int ret;
const struct pci9111_board *board;
- if (alloc_private(dev, sizeof(struct pci9111_private_data)) < 0)
- return -ENOMEM;
+ ret = alloc_private(dev, sizeof(*dev_private));
+ if (ret)
+ return ret;
+ dev_private = dev->private;
+
/* Probe the device to determine what device in the series it is. */
printk(KERN_ERR "comedi%d: " PCI9111_DRIVER_NAME " driver\n",
/* TODO: Add external multiplexer setup (according to option[2]). */
- error = comedi_alloc_subdevices(dev, 4);
- if (error)
- return error;
+ ret = comedi_alloc_subdevices(dev, 4);
+ if (ret)
+ return ret;
s = &dev->subdevices[0];
dev->read_subdev = s;
static void pci9111_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
+ struct pci9111_private_data *dev_private = dev->private;
- if (dev->private != NULL) {
+ if (dev_private) {
if (dev_private->is_valid)
pci9111_reset(dev);
}