From teknotus@teknot.us Mon Oct 19 14:38:19 2009 From: Daniel Patrick Johnson Date: Wed, 14 Oct 2009 02:04:23 +0000 Subject: Staging: comedi: pcmmio: Coding style cleanup To: greg@kroah.com Cc: Daniel Patrick Johnson Message-ID: <1255485864-7091-3-git-send-email-teknotus@teknot.us> Signed-off-by: Daniel Patrick Johnson Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcmmio.c | 121 +++++++++++++++++++++----------- 1 file changed, 82 insertions(+), 39 deletions(-) --- a/drivers/staging/comedi/drivers/pcmmio.c +++ b/drivers/staging/comedi/drivers/pcmmio.c @@ -32,8 +32,10 @@ Winsystems. This board is a PC-104 base four subdevices: subdevice 0 - 16 channels of 16-bit AI subdevice 1 - 8 channels of 16-bit AO - subdevice 2 - first 24 channels of the 48 channel of DIO (with edge-triggered interrupt support) - subdevice 3 - last 24 channels of the 48 channel DIO (no interrupt support for this bank of channels) + subdevice 2 - first 24 channels of the 48 channel of DIO + (with edge-triggered interrupt support) + subdevice 3 - last 24 channels of the 48 channel DIO + (no interrupt support for this bank of channels) Some notes: @@ -70,7 +72,8 @@ four subdevices: Configuration Options: [0] - I/O port base address - [1] - IRQ (optional -- for edge-detect interrupt support only, leave out if you don't need this feature) + [1] - IRQ (optional -- for edge-detect interrupt support only, + leave out if you don't need this feature) */ #include @@ -115,9 +118,11 @@ Configuration Options: #define REG_PORT4 0x4 #define REG_PORT5 0x5 #define REG_INT_PENDING 0x6 -#define REG_PAGELOCK 0x7 /* page selector register, upper 2 bits select a page - and bits 0-5 are used to 'lock down' a particular - port above to make it readonly. */ +#define REG_PAGELOCK 0x7 /* + * page selector register, upper 2 bits select + * a page and bits 0-5 are used to 'lock down' + * a particular port above to make it readonly. + */ #define REG_POL0 0x8 #define REG_POL1 0x9 #define REG_POL2 0xA @@ -134,7 +139,7 @@ Configuration Options: #define REG_PAGE_BITOFFSET 6 #define REG_LOCK_BITOFFSET 0 #define REG_PAGE_MASK (~((0x1<asics[asic].num = asic; devpriv->asics[asic].iobase = dev->iobase + 16 + asic * ASIC_IOSIZE; - devpriv->asics[asic].irq = 0; /* this gets actually set at the end of - this function when we - request_irqs */ + /* + * this gets actually set at the end of this function when we + * request_irqs + */ + devpriv->asics[asic].irq = 0; spin_lock_init(&devpriv->asics[asic].spinlock); } @@ -463,7 +492,10 @@ static int pcmmio_attach(struct comedi_d if (thisasic_chanct < CHANS_PER_PORT * INTR_PORTS_PER_ASIC && subpriv->dio.intr.asic < 0) { - /* this is an interrupt subdevice, so setup the struct */ + /* + * this is an interrupt subdevice, + * so setup the struct + */ subpriv->dio.intr.asic = asic; subpriv->dio.intr.active = 0; subpriv->dio.intr.stop_count = 0; @@ -484,7 +516,11 @@ static int pcmmio_attach(struct comedi_d chans_left -= s->n_chan; if (!chans_left) { - asic = 0; /* reset the asic to our first asic, to do intr subdevs */ + /* + * reset the asic to our first asic, + * to do intr subdevs + */ + asic = 0; port = 0; } @@ -507,8 +543,10 @@ static int pcmmio_attach(struct comedi_d devpriv->asics[asic].irq = irq[asic]; } - dev->irq = irq[0]; /* grr.. wish comedi dev struct supported multiple - irqs.. */ + dev->irq = irq[0]; /* + * grr.. wish comedi dev struct supported + * multiple irqs.. + */ if (irq[0]) { printk("irq: %u ", irq[0]); @@ -604,9 +642,14 @@ static int pcmmio_dio_insn_bits(struct c #endif if (write_mask_byte) { - /* this byte has some write_bits -- so set the output lines */ - byte &= ~write_mask_byte; /* clear bits for write mask */ - byte |= ~data_byte & write_mask_byte; /* set to inverted data_byte */ + /* + * this byte has some write_bits + * -- so set the output lines + */ + /* clear bits for write mask */ + byte &= ~write_mask_byte; + /* set to inverted data_byte */ + byte |= ~data_byte & write_mask_byte; /* Write out the new digital output state */ outb(byte, ioaddr); }