diff options
author | tony burrows <tony@tonyburrows.com> | 2010-02-02 11:52:49 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-03 19:42:55 -0500 |
commit | 412bd046b0a1726f8b168d5056d21213932f9d84 (patch) | |
tree | dc7a46e350512682333833b5cc210fac25668e17 /drivers | |
parent | c7e10c99565d7a4d2f4bcc37e7bccd6c8120a0a3 (diff) |
Staging: comedi: fix brace coding style issues in ni_labpc.c
This patch fixes all of the brace style warnings found by the
checkpatch.pl tool
Signed-off-by: Tony Burrows <tony@tonyburrows.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/comedi/drivers/ni_labpc.c | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c index 647c9b72b551..566b791e00c7 100644 --- a/drivers/staging/comedi/drivers/ni_labpc.c +++ b/drivers/staging/comedi/drivers/ni_labpc.c | |||
@@ -483,12 +483,10 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase, | |||
483 | 483 | ||
484 | printk("comedi%d: ni_labpc: %s, io 0x%lx", dev->minor, thisboard->name, | 484 | printk("comedi%d: ni_labpc: %s, io 0x%lx", dev->minor, thisboard->name, |
485 | iobase); | 485 | iobase); |
486 | if (irq) { | 486 | if (irq) |
487 | printk(", irq %u", irq); | 487 | printk(", irq %u", irq); |
488 | } | 488 | if (dma_chan) |
489 | if (dma_chan) { | ||
490 | printk(", dma %u", dma_chan); | 489 | printk(", dma %u", dma_chan); |
491 | } | ||
492 | printk("\n"); | 490 | printk("\n"); |
493 | 491 | ||
494 | if (iobase == 0) { | 492 | if (iobase == 0) { |
@@ -585,8 +583,9 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase, | |||
585 | /* analog output */ | 583 | /* analog output */ |
586 | s = dev->subdevices + 1; | 584 | s = dev->subdevices + 1; |
587 | if (thisboard->has_ao) { | 585 | if (thisboard->has_ao) { |
588 | /* Could provide command support, except it only has a one sample | 586 | /* Could provide command support, except it only has a |
589 | * hardware buffer for analog output and no underrun flag. */ | 587 | * one sample hardware buffer for analog output and no |
588 | * underrun flag. */ | ||
590 | s->type = COMEDI_SUBD_AO; | 589 | s->type = COMEDI_SUBD_AO; |
591 | s->subdev_flags = SDF_READABLE | SDF_WRITABLE | SDF_GROUND; | 590 | s->subdev_flags = SDF_READABLE | SDF_WRITABLE | SDF_GROUND; |
592 | s->n_chan = NUM_AO_CHAN; | 591 | s->n_chan = NUM_AO_CHAN; |
@@ -608,7 +607,8 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase, | |||
608 | 607 | ||
609 | /* 8255 dio */ | 608 | /* 8255 dio */ |
610 | s = dev->subdevices + 2; | 609 | s = dev->subdevices + 2; |
611 | /* if board uses io memory we have to give a custom callback function to the 8255 driver */ | 610 | /* if board uses io memory we have to give a custom callback |
611 | * function to the 8255 driver */ | ||
612 | if (thisboard->memory_mapped_io) | 612 | if (thisboard->memory_mapped_io) |
613 | subdev_8255_init(dev, s, labpc_dio_mem_callback, | 613 | subdev_8255_init(dev, s, labpc_dio_mem_callback, |
614 | (unsigned long)(dev->iobase + DIO_BASE_REG)); | 614 | (unsigned long)(dev->iobase + DIO_BASE_REG)); |
@@ -640,14 +640,12 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase, | |||
640 | s->insn_read = labpc_eeprom_read_insn; | 640 | s->insn_read = labpc_eeprom_read_insn; |
641 | s->insn_write = labpc_eeprom_write_insn; | 641 | s->insn_write = labpc_eeprom_write_insn; |
642 | 642 | ||
643 | for (i = 0; i < EEPROM_SIZE; i++) { | 643 | for (i = 0; i < EEPROM_SIZE; i++) |
644 | devpriv->eeprom_data[i] = labpc_eeprom_read(dev, i); | 644 | devpriv->eeprom_data[i] = labpc_eeprom_read(dev, i); |
645 | } | ||
646 | #ifdef LABPC_DEBUG | 645 | #ifdef LABPC_DEBUG |
647 | printk(" eeprom:"); | 646 | printk(" eeprom:"); |
648 | for (i = 0; i < EEPROM_SIZE; i++) { | 647 | for (i = 0; i < EEPROM_SIZE; i++) |
649 | printk(" %i:0x%x ", i, devpriv->eeprom_data[i]); | 648 | printk(" %i:0x%x ", i, devpriv->eeprom_data[i]); |
650 | } | ||
651 | printk("\n"); | 649 | printk("\n"); |
652 | #endif | 650 | #endif |
653 | } else | 651 | } else |
@@ -679,9 +677,8 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
679 | case pci_bustype: | 677 | case pci_bustype: |
680 | #ifdef CONFIG_COMEDI_PCI | 678 | #ifdef CONFIG_COMEDI_PCI |
681 | retval = labpc_find_device(dev, it->options[0], it->options[1]); | 679 | retval = labpc_find_device(dev, it->options[0], it->options[1]); |
682 | if (retval < 0) { | 680 | if (retval < 0) |
683 | return retval; | 681 | return retval; |
684 | } | ||
685 | retval = mite_setup(devpriv->mite); | 682 | retval = mite_setup(devpriv->mite); |
686 | if (retval < 0) | 683 | if (retval < 0) |
687 | return retval; | 684 | return retval; |
@@ -1008,9 +1005,9 @@ static int labpc_ai_cmdtest(struct comedi_device *dev, | |||
1008 | err++; | 1005 | err++; |
1009 | } | 1006 | } |
1010 | 1007 | ||
1011 | if (!cmd->chanlist_len) { | 1008 | if (!cmd->chanlist_len) |
1012 | err++; | 1009 | err++; |
1013 | } | 1010 | |
1014 | if (cmd->scan_end_arg != cmd->chanlist_len) { | 1011 | if (cmd->scan_end_arg != cmd->chanlist_len) { |
1015 | cmd->scan_end_arg = cmd->chanlist_len; | 1012 | cmd->scan_end_arg = cmd->chanlist_len; |
1016 | err++; | 1013 | err++; |
@@ -1105,9 +1102,8 @@ static int labpc_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) | |||
1105 | devpriv->write_byte(devpriv->command3_bits, dev->iobase + COMMAND3_REG); | 1102 | devpriv->write_byte(devpriv->command3_bits, dev->iobase + COMMAND3_REG); |
1106 | 1103 | ||
1107 | /* initialize software conversion count */ | 1104 | /* initialize software conversion count */ |
1108 | if (cmd->stop_src == TRIG_COUNT) { | 1105 | if (cmd->stop_src == TRIG_COUNT) |
1109 | devpriv->count = cmd->stop_arg * cmd->chanlist_len; | 1106 | devpriv->count = cmd->stop_arg * cmd->chanlist_len; |
1110 | } | ||
1111 | /* setup hardware conversion counter */ | 1107 | /* setup hardware conversion counter */ |
1112 | if (cmd->stop_src == TRIG_EXT) { | 1108 | if (cmd->stop_src == TRIG_EXT) { |
1113 | /* load counter a1 with count of 3 (pc+ manual says this is minimum allowed) using mode 0 */ | 1109 | /* load counter a1 with count of 3 (pc+ manual says this is minimum allowed) using mode 0 */ |
@@ -1479,9 +1475,8 @@ static void labpc_drain_dma(struct comedi_device *dev) | |||
1479 | } | 1475 | } |
1480 | 1476 | ||
1481 | /* write data to comedi buffer */ | 1477 | /* write data to comedi buffer */ |
1482 | for (i = 0; i < num_points; i++) { | 1478 | for (i = 0; i < num_points; i++) |
1483 | cfc_write_to_buffer(s, devpriv->dma_buffer[i]); | 1479 | cfc_write_to_buffer(s, devpriv->dma_buffer[i]); |
1484 | } | ||
1485 | if (async->cmd.stop_src == TRIG_COUNT) | 1480 | if (async->cmd.stop_src == TRIG_COUNT) |
1486 | devpriv->count -= num_points; | 1481 | devpriv->count -= num_points; |
1487 | 1482 | ||
@@ -1864,9 +1859,8 @@ static unsigned int labpc_serial_in(struct comedi_device *dev) | |||
1864 | udelay(1); | 1859 | udelay(1); |
1865 | devpriv->status2_bits = | 1860 | devpriv->status2_bits = |
1866 | devpriv->read_byte(dev->iobase + STATUS2_REG); | 1861 | devpriv->read_byte(dev->iobase + STATUS2_REG); |
1867 | if (devpriv->status2_bits & EEPROM_OUT_BIT) { | 1862 | if (devpriv->status2_bits & EEPROM_OUT_BIT) |
1868 | value |= 1 << (value_width - i); | 1863 | value |= 1 << (value_width - i); |
1869 | } | ||
1870 | } | 1864 | } |
1871 | 1865 | ||
1872 | return value; | 1866 | return value; |