diff options
Diffstat (limited to 'drivers/staging/comedi/drivers/amplc_pc263.c')
-rw-r--r-- | drivers/staging/comedi/drivers/amplc_pc263.c | 82 |
1 files changed, 43 insertions, 39 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_pc263.c b/drivers/staging/comedi/drivers/amplc_pc263.c index 97ac4157ada..730b67743f0 100644 --- a/drivers/staging/comedi/drivers/amplc_pc263.c +++ b/drivers/staging/comedi/drivers/amplc_pc263.c @@ -74,27 +74,27 @@ struct pc263_board { }; static const struct pc263_board pc263_boards[] = { { - name: "pc263", - fancy_name:"PC263", - bustype: isa_bustype, - model: pc263_model, + .name = "pc263", + .fancy_name = "PC263", + .bustype = isa_bustype, + .model = pc263_model, }, #ifdef CONFIG_COMEDI_PCI { - name: "pci263", - fancy_name:"PCI263", - devid: PCI_DEVICE_ID_AMPLICON_PCI263, - bustype: pci_bustype, - model: pci263_model, + .name = "pci263", + .fancy_name = "PCI263", + .devid = PCI_DEVICE_ID_AMPLICON_PCI263, + .bustype = pci_bustype, + .model = pci263_model, }, #endif #ifdef CONFIG_COMEDI_PCI { - name: PC263_DRIVER_NAME, - fancy_name:PC263_DRIVER_NAME, - devid: PCI_DEVICE_ID_INVALID, - bustype: pci_bustype, - model: anypci_model, /* wildcard */ + .name = PC263_DRIVER_NAME, + .fancy_name = PC263_DRIVER_NAME, + .devid = PCI_DEVICE_ID_INVALID, + .bustype = pci_bustype, + .model = anypci_model, /* wildcard */ }, #endif }; @@ -132,24 +132,24 @@ struct pc263_private { * the board, and also about the kernel module that contains * the device code. */ -static int pc263_attach(struct comedi_device * dev, struct comedi_devconfig * it); -static int pc263_detach(struct comedi_device * dev); +static int pc263_attach(struct comedi_device *dev, struct comedi_devconfig *it); +static int pc263_detach(struct comedi_device *dev); static struct comedi_driver driver_amplc_pc263 = { - driver_name:PC263_DRIVER_NAME, - module:THIS_MODULE, - attach:pc263_attach, - detach:pc263_detach, - board_name:&pc263_boards[0].name, - offset:sizeof(struct pc263_board), - num_names:sizeof(pc263_boards) / sizeof(struct pc263_board), + .driver_name = PC263_DRIVER_NAME, + .module = THIS_MODULE, + .attach = pc263_attach, + .detach = pc263_detach, + .board_name = &pc263_boards[0].name, + .offset = sizeof(struct pc263_board), + .num_names = ARRAY_SIZE(pc263_boards), }; static int pc263_request_region(unsigned minor, unsigned long from, unsigned long extent); -static int pc263_dio_insn_bits(struct comedi_device * dev, struct comedi_subdevice * s, - struct comedi_insn * insn, unsigned int * data); -static int pc263_dio_insn_config(struct comedi_device * dev, struct comedi_subdevice * s, - struct comedi_insn * insn, unsigned int * data); +static int pc263_dio_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s, + struct comedi_insn *insn, unsigned int *data); +static int pc263_dio_insn_config(struct comedi_device *dev, struct comedi_subdevice *s, + struct comedi_insn *insn, unsigned int *data); /* * This function looks for a PCI device matching the requested board name, @@ -157,7 +157,7 @@ static int pc263_dio_insn_config(struct comedi_device * dev, struct comedi_subde */ #ifdef CONFIG_COMEDI_PCI static int -pc263_find_pci(struct comedi_device * dev, int bus, int slot, +pc263_find_pci(struct comedi_device *dev, int bus, int slot, struct pci_dev **pci_dev_p) { struct pci_dev *pci_dev = NULL; @@ -219,7 +219,7 @@ pc263_find_pci(struct comedi_device * dev, int bus, int slot, * in the driver structure, dev->board_ptr contains that * address. */ -static int pc263_attach(struct comedi_device * dev, struct comedi_devconfig * it) +static int pc263_attach(struct comedi_device *dev, struct comedi_devconfig *it) { struct comedi_subdevice *s; unsigned long iobase = 0; @@ -236,7 +236,8 @@ static int pc263_attach(struct comedi_device * dev, struct comedi_devconfig * it * convenient macro defined in comedidev.h. */ #ifdef CONFIG_COMEDI_PCI - if ((ret = alloc_private(dev, sizeof(struct pc263_private))) < 0) { + ret = alloc_private(dev, sizeof(struct pc263_private)); + if (ret < 0) { printk(KERN_ERR "comedi%d: error! out of memory!\n", dev->minor); return ret; @@ -252,7 +253,8 @@ static int pc263_attach(struct comedi_device * dev, struct comedi_devconfig * it bus = it->options[0]; slot = it->options[1]; - if ((ret = pc263_find_pci(dev, bus, slot, &pci_dev)) < 0) + ret = pc263_find_pci(dev, bus, slot, &pci_dev); + if (ret < 0) return ret; devpriv->pci_dev = pci_dev; break; @@ -273,7 +275,8 @@ static int pc263_attach(struct comedi_device * dev, struct comedi_devconfig * it /* Enable device and reserve I/O spaces. */ #ifdef CONFIG_COMEDI_PCI if (pci_dev) { - if ((ret = comedi_pci_enable(pci_dev, PC263_DRIVER_NAME)) < 0) { + ret = comedi_pci_enable(pci_dev, PC263_DRIVER_NAME); + if (ret < 0) { printk(KERN_ERR "comedi%d: error! cannot enable PCI device and request regions!\n", dev->minor); @@ -294,7 +297,8 @@ static int pc263_attach(struct comedi_device * dev, struct comedi_devconfig * it * Allocate the subdevice structures. alloc_subdevice() is a * convenient macro defined in comedidev.h. */ - if ((ret = alloc_subdevices(dev, 1)) < 0) { + ret = alloc_subdevices(dev, 1); + if (ret < 0) { printk(KERN_ERR "comedi%d: error! out of memory!\n", dev->minor); return ret; @@ -303,7 +307,7 @@ static int pc263_attach(struct comedi_device * dev, struct comedi_devconfig * it s = dev->subdevices + 0; /* digital i/o subdevice */ s->type = COMEDI_SUBD_DIO; - s->subdev_flags = SDF_READABLE | SDF_WRITABLE | SDF_RT; + s->subdev_flags = SDF_READABLE | SDF_WRITABLE; s->n_chan = 16; s->maxdata = 1; s->range_table = &range_digital; @@ -337,7 +341,7 @@ static int pc263_attach(struct comedi_device * dev, struct comedi_devconfig * it * allocated by _attach(). dev->private and dev->subdevices are * deallocated automatically by the core. */ -static int pc263_detach(struct comedi_device * dev) +static int pc263_detach(struct comedi_device *dev) { printk(KERN_DEBUG "comedi%d: %s: detach\n", dev->minor, PC263_DRIVER_NAME); @@ -387,8 +391,8 @@ static int pc263_request_region(unsigned minor, unsigned long from, * useful to applications if you implement the insn_bits interface. * This allows packed reading/writing of the DIO channels. The * comedi core can convert between insn_bits and insn_read/write */ -static int pc263_dio_insn_bits(struct comedi_device * dev, struct comedi_subdevice * s, - struct comedi_insn * insn, unsigned int * data) +static int pc263_dio_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s, + struct comedi_insn *insn, unsigned int *data) { if (insn->n != 2) return -EINVAL; @@ -412,8 +416,8 @@ static int pc263_dio_insn_bits(struct comedi_device * dev, struct comedi_subdevi return 2; } -static int pc263_dio_insn_config(struct comedi_device * dev, struct comedi_subdevice * s, - struct comedi_insn * insn, unsigned int * data) +static int pc263_dio_insn_config(struct comedi_device *dev, struct comedi_subdevice *s, + struct comedi_insn *insn, unsigned int *data) { if (insn->n != 1) return -EINVAL; |