Commit af6ddd57 authored by Maurice Dawson's avatar Maurice Dawson Committed by Greg Kroah-Hartman

Staging: comedi: fix brace, print(k) and over 80 character coding style issues in adv_pci1723.c

This is a Patch to the adv_pci1723.c file that fixes up brace, print(k) and over 80 character warnings found by the checkpatch.pl tool
Signed-off-by: default avatarMaurice Dawson <mauricedawson2699@googlemail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent cf8d3af5
......@@ -62,21 +62,34 @@ configures all channels in the same group.
/* all the registers for the pci1723 board */
#define PCI1723_DA(N) ((N)<<1) /* W: D/A register N (0 to 7) */
#define PCI1723_SYN_SET 0x12 /*synchronized set register */
#define PCI1723_ALL_CHNNELE_SYN_STROBE 0x12 /*synchronized status register */
#define PCI1723_SYN_SET 0x12 /* synchronized set register */
#define PCI1723_ALL_CHNNELE_SYN_STROBE 0x12
/* synchronized status register */
#define PCI1723_RANGE_CALIBRATION_MODE 0x14 /* range and calibration mode */
#define PCI1723_RANGE_CALIBRATION_STATUS 0x14 /* range and calibration status */
#define PCI1723_RANGE_CALIBRATION_MODE 0x14
/* range and calibration mode */
#define PCI1723_RANGE_CALIBRATION_STATUS 0x14
/* range and calibration status */
#define PCI1723_CONTROL_CMD_CALIBRATION_FUN 0x16 /* SADC control command for calibration function */
#define PCI1723_STATUS_CMD_CALIBRATION_FUN 0x16 /* SADC control status for calibration function */
#define PCI1723_CONTROL_CMD_CALIBRATION_FUN 0x16
/*
* SADC control command for
* calibration function
*/
#define PCI1723_STATUS_CMD_CALIBRATION_FUN 0x16
/*
* SADC control status for
* calibration function
*/
#define PCI1723_CALIBRATION_PARA_STROBE 0x18 /* Calibration parameter strobe */
#define PCI1723_CALIBRATION_PARA_STROBE 0x18
/* Calibration parameter strobe */
#define PCI1723_DIGITAL_IO_PORT_SET 0x1A /* Digital I/O port setting */
#define PCI1723_DIGITAL_IO_PORT_MODE 0x1A /* Digital I/O port mode */
#define PCI1723_WRITE_DIGITAL_OUTPUT_CMD 0x1C /* Write digital output command */
#define PCI1723_WRITE_DIGITAL_OUTPUT_CMD 0x1C
/* Write digital output command */
#define PCI1723_READ_DIGITAL_INPUT_DATA 0x1C /* Read digital input data */
#define PCI1723_WRITE_CAL_CMD 0x1E /* Write calibration command */
......@@ -84,11 +97,20 @@ configures all channels in the same group.
#define PCI1723_SYN_STROBE 0x20 /* Synchronized strobe */
#define PCI1723_RESET_ALL_CHN_STROBE 0x22 /* Reset all D/A channels strobe */
#define PCI1723_RESET_ALL_CHN_STROBE 0x22
/* Reset all D/A channels strobe */
#define PCI1723_RESET_CAL_CONTROL_STROBE 0x24 /* Reset the calibration controller strobe */
#define PCI1723_RESET_CAL_CONTROL_STROBE 0x24
/*
* Reset the calibration
* controller strobe
*/
#define PCI1723_CHANGE_CHA_OUTPUT_TYPE_STROBE 0x26 /* Change D/A channels output type strobe */
#define PCI1723_CHANGE_CHA_OUTPUT_TYPE_STROBE 0x26
/*
* Change D/A channels output
* type strobe
*/
#define PCI1723_SELECT_CALIBRATION 0x28 /* Select the calibration Ref_V */
......@@ -128,8 +150,10 @@ static const struct pci1723_board boardtypes[] = {
},
};
/* This is used by modprobe to translate PCI IDs to drivers. Should
* only be used for PCI and ISA-PnP devices */
/*
* This is used by modprobe to translate PCI IDs to drivers.
* Should only be used for PCI and ISA-PnP devices
*/
static DEFINE_PCI_DEVICE_TABLE(pci1723_pci_table) = {
{
PCI_VENDOR_ID_ADVANTECH, 0x1723, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
......@@ -157,7 +181,7 @@ static struct comedi_driver driver_pci1723 = {
.detach = pci1723_detach,
};
/* this structure is for data unique to this hardware driver. */
/* This structure is for data unique to this hardware driver. */
struct pci1723_private {
int valid; /* card is usable; */
......@@ -167,22 +191,21 @@ struct pci1723_private {
short ao_data[8]; /* data output buffer */
};
/*the following macro to make it easy to
* access the private structure.
*/
/* The following macro to make it easy to access the private structure. */
#define devpriv ((struct pci1723_private *)dev->private)
#define this_board boardtypes
/*
* the pci1723 card reset;
* The pci1723 card reset;
*/
static int pci1723_reset(struct comedi_device *dev)
{
int i;
DPRINTK("adv_pci1723 EDBG: BGN: pci1723_reset(...)\n");
outw(0x01, dev->iobase + PCI1723_SYN_SET); /* set synchronous output mode */
outw(0x01, dev->iobase + PCI1723_SYN_SET);
/* set synchronous output mode */
for (i = 0; i < 8; i++) {
/* set all outputs to 0V */
......@@ -194,7 +217,8 @@ static int pci1723_reset(struct comedi_device *dev)
PCI1723_RANGE_CALIBRATION_MODE);
}
outw(0, dev->iobase + PCI1723_CHANGE_CHA_OUTPUT_TYPE_STROBE); /* update ranges */
outw(0, dev->iobase + PCI1723_CHANGE_CHA_OUTPUT_TYPE_STROBE);
/* update ranges */
outw(0, dev->iobase + PCI1723_SYN_STROBE); /* update outputs */
/* set asynchronous output mode */
......@@ -251,11 +275,11 @@ static int pci1723_dio_insn_config(struct comedi_device *dev,
unsigned short dio_mode;
mask = 1 << CR_CHAN(insn->chanspec);
if (mask & 0x00FF) {
if (mask & 0x00FF)
bits = 0x00FF;
} else {
else
bits = 0xFF00;
}
switch (data[0]) {
case INSN_CONFIG_DIO_INPUT:
s->io_bits &= ~bits;
......@@ -311,7 +335,8 @@ static int pci1723_attach(struct comedi_device *dev,
int opt_bus, opt_slot;
const char *errstr;
printk("comedi%d: adv_pci1723: board=%s", dev->minor, this_board->name);
printk(KERN_ERR "comedi%d: adv_pci1723: board=%s",
dev->minor, this_board->name);
opt_bus = it->options[0];
opt_slot = it->options[1];
......@@ -349,10 +374,10 @@ static int pci1723_attach(struct comedi_device *dev,
if (!pcidev) {
if (opt_bus || opt_slot) {
printk(" - Card at b:s %d:%d %s\n",
printk(KERN_ERR " - Card at b:s %d:%d %s\n",
opt_bus, opt_slot, errstr);
} else {
printk(" - Card %s\n", errstr);
printk(KERN_ERR " - Card %s\n", errstr);
}
return -EIO;
}
......@@ -362,8 +387,8 @@ static int pci1723_attach(struct comedi_device *dev,
pci_func = PCI_FUNC(pcidev->devfn);
iobase = pci_resource_start(pcidev, 2);
printk(", b:s:f=%d:%d:%d, io=0x%4x", pci_bus, pci_slot, pci_func,
iobase);
printk(KERN_ERR ", b:s:f=%d:%d:%d, io=0x%4x",
pci_bus, pci_slot, pci_func, iobase);
dev->iobase = iobase;
......@@ -399,7 +424,8 @@ static int pci1723_attach(struct comedi_device *dev,
s->insn_read = pci1723_insn_read_ao;
/* read DIO config */
switch (inw(dev->iobase + PCI1723_DIGITAL_IO_PORT_MODE) & 0x03) {
switch (inw(dev->iobase + PCI1723_DIGITAL_IO_PORT_MODE)
& 0x03) {
case 0x00: /* low byte output, high byte output */
s->io_bits = 0xFFFF;
break;
......@@ -450,16 +476,15 @@ static int pci1723_attach(struct comedi_device *dev,
*/
static int pci1723_detach(struct comedi_device *dev)
{
printk("comedi%d: pci1723: remove\n", dev->minor);
printk(KERN_ERR "comedi%d: pci1723: remove\n", dev->minor);
if (dev->private) {
if (devpriv->valid)
pci1723_reset(dev);
if (devpriv->pcidev) {
if (dev->iobase) {
if (dev->iobase)
comedi_pci_disable(devpriv->pcidev);
}
pci_dev_put(devpriv->pcidev);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment