Commit 652dd4e7 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: comedi: fix comedi_parport.c checkpatch.pl issues.

This resolves all the resolvable checkpatch.pl issues in the
comedi_parport.c file.

Cc: David Schleef <ds@schleef.org>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8c49292f
...@@ -90,26 +90,26 @@ pin, which can be used to wake up tasks. ...@@ -90,26 +90,26 @@ pin, which can be used to wake up tasks.
#define PARPORT_B 1 #define PARPORT_B 1
#define PARPORT_C 2 #define PARPORT_C 2
static int parport_attach(comedi_device * dev, comedi_devconfig * it); static int parport_attach(comedi_device *dev, comedi_devconfig *it);
static int parport_detach(comedi_device * dev); static int parport_detach(comedi_device *dev);
static comedi_driver driver_parport = { static comedi_driver driver_parport = {
driver_name:"comedi_parport", .driver_name = "comedi_parport",
module:THIS_MODULE, .module = THIS_MODULE,
attach:parport_attach, .attach = parport_attach,
detach:parport_detach, .detach = parport_detach,
}; };
COMEDI_INITCLEANUP(driver_parport); COMEDI_INITCLEANUP(driver_parport);
typedef struct parport_private_struct { struct parport_private {
unsigned int a_data; unsigned int a_data;
unsigned int c_data; unsigned int c_data;
int enable_irq; int enable_irq;
} parport_private; };
#define devpriv ((parport_private *)(dev->private)) #define devpriv ((struct parport_private *)(dev->private))
static int parport_insn_a(comedi_device * dev, comedi_subdevice * s, static int parport_insn_a(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
if (data[0]) { if (data[0]) {
devpriv->a_data &= ~data[0]; devpriv->a_data &= ~data[0];
...@@ -123,8 +123,8 @@ static int parport_insn_a(comedi_device * dev, comedi_subdevice * s, ...@@ -123,8 +123,8 @@ static int parport_insn_a(comedi_device * dev, comedi_subdevice * s,
return 2; return 2;
} }
static int parport_insn_config_a(comedi_device * dev, comedi_subdevice * s, static int parport_insn_config_a(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
if (data[0]) { if (data[0]) {
s->io_bits = 0xff; s->io_bits = 0xff;
...@@ -138,11 +138,12 @@ static int parport_insn_config_a(comedi_device * dev, comedi_subdevice * s, ...@@ -138,11 +138,12 @@ static int parport_insn_config_a(comedi_device * dev, comedi_subdevice * s,
return 1; return 1;
} }
static int parport_insn_b(comedi_device * dev, comedi_subdevice * s, static int parport_insn_b(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
if (data[0]) { if (data[0]) {
// should writes be ignored? /* should writes be ignored? */
/* anyone??? */
} }
data[1] = (inb(dev->iobase + PARPORT_B) >> 3); data[1] = (inb(dev->iobase + PARPORT_B) >> 3);
...@@ -150,8 +151,8 @@ static int parport_insn_b(comedi_device * dev, comedi_subdevice * s, ...@@ -150,8 +151,8 @@ static int parport_insn_b(comedi_device * dev, comedi_subdevice * s,
return 2; return 2;
} }
static int parport_insn_c(comedi_device * dev, comedi_subdevice * s, static int parport_insn_c(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
data[0] &= 0x0f; data[0] &= 0x0f;
if (data[0]) { if (data[0]) {
...@@ -166,8 +167,8 @@ static int parport_insn_c(comedi_device * dev, comedi_subdevice * s, ...@@ -166,8 +167,8 @@ static int parport_insn_c(comedi_device * dev, comedi_subdevice * s,
return 2; return 2;
} }
static int parport_intr_insn(comedi_device * dev, comedi_subdevice * s, static int parport_intr_insn(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
if (insn->n < 1) if (insn->n < 1)
return -EINVAL; return -EINVAL;
...@@ -176,8 +177,8 @@ static int parport_intr_insn(comedi_device * dev, comedi_subdevice * s, ...@@ -176,8 +177,8 @@ static int parport_intr_insn(comedi_device * dev, comedi_subdevice * s,
return 2; return 2;
} }
static int parport_intr_cmdtest(comedi_device * dev, comedi_subdevice * s, static int parport_intr_cmdtest(comedi_device *dev, comedi_subdevice *s,
comedi_cmd * cmd) comedi_cmd *cmd)
{ {
int err = 0; int err = 0;
int tmp; int tmp;
...@@ -251,7 +252,7 @@ static int parport_intr_cmdtest(comedi_device * dev, comedi_subdevice * s, ...@@ -251,7 +252,7 @@ static int parport_intr_cmdtest(comedi_device * dev, comedi_subdevice * s,
return 0; return 0;
} }
static int parport_intr_cmd(comedi_device * dev, comedi_subdevice * s) static int parport_intr_cmd(comedi_device *dev, comedi_subdevice *s)
{ {
devpriv->c_data |= 0x10; devpriv->c_data |= 0x10;
outb(devpriv->c_data, dev->iobase + PARPORT_C); outb(devpriv->c_data, dev->iobase + PARPORT_C);
...@@ -261,9 +262,9 @@ static int parport_intr_cmd(comedi_device * dev, comedi_subdevice * s) ...@@ -261,9 +262,9 @@ static int parport_intr_cmd(comedi_device * dev, comedi_subdevice * s)
return 0; return 0;
} }
static int parport_intr_cancel(comedi_device * dev, comedi_subdevice * s) static int parport_intr_cancel(comedi_device *dev, comedi_subdevice *s)
{ {
printk("parport_intr_cancel()\n"); printk(KERN_DEBUG "parport_intr_cancel()\n");
devpriv->c_data &= ~0x10; devpriv->c_data &= ~0x10;
outb(devpriv->c_data, dev->iobase + PARPORT_C); outb(devpriv->c_data, dev->iobase + PARPORT_C);
...@@ -279,7 +280,7 @@ static irqreturn_t parport_interrupt(int irq, void *d PT_REGS_ARG) ...@@ -279,7 +280,7 @@ static irqreturn_t parport_interrupt(int irq, void *d PT_REGS_ARG)
comedi_subdevice *s = dev->subdevices + 3; comedi_subdevice *s = dev->subdevices + 3;
if (!devpriv->enable_irq) { if (!devpriv->enable_irq) {
printk("comedi_parport: bogus irq, ignored\n"); printk(KERN_ERR "comedi_parport: bogus irq, ignored\n");
return IRQ_NONE; return IRQ_NONE;
} }
...@@ -290,7 +291,7 @@ static irqreturn_t parport_interrupt(int irq, void *d PT_REGS_ARG) ...@@ -290,7 +291,7 @@ static irqreturn_t parport_interrupt(int irq, void *d PT_REGS_ARG)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static int parport_attach(comedi_device * dev, comedi_devconfig * it) static int parport_attach(comedi_device *dev, comedi_devconfig *it)
{ {
int ret; int ret;
unsigned int irq; unsigned int irq;
...@@ -298,7 +299,7 @@ static int parport_attach(comedi_device * dev, comedi_devconfig * it) ...@@ -298,7 +299,7 @@ static int parport_attach(comedi_device * dev, comedi_devconfig * it)
comedi_subdevice *s; comedi_subdevice *s;
iobase = it->options[0]; iobase = it->options[0];
printk("comedi%d: parport: 0x%04lx ", dev->minor, iobase); printk(KERN_INFO "comedi%d: parport: 0x%04lx ", dev->minor, iobase);
if (!request_region(iobase, PARPORT_SIZE, "parport (comedi)")) { if (!request_region(iobase, PARPORT_SIZE, "parport (comedi)")) {
printk("I/O port conflict\n"); printk("I/O port conflict\n");
return -EIO; return -EIO;
...@@ -318,9 +319,11 @@ static int parport_attach(comedi_device * dev, comedi_devconfig * it) ...@@ -318,9 +319,11 @@ static int parport_attach(comedi_device * dev, comedi_devconfig * it)
} }
dev->board_name = "parport"; dev->board_name = "parport";
if ((ret = alloc_subdevices(dev, 4)) < 0) ret = alloc_subdevices(dev, 4);
if (ret < 0)
return ret; return ret;
if ((ret = alloc_private(dev, sizeof(parport_private))) < 0) ret = alloc_private(dev, sizeof(struct parport_private));
if (ret < 0)
return ret; return ret;
s = dev->subdevices + 0; s = dev->subdevices + 0;
...@@ -373,7 +376,7 @@ static int parport_attach(comedi_device * dev, comedi_devconfig * it) ...@@ -373,7 +376,7 @@ static int parport_attach(comedi_device * dev, comedi_devconfig * it)
return 1; return 1;
} }
static int parport_detach(comedi_device * dev) static int parport_detach(comedi_device *dev)
{ {
printk("comedi%d: parport: remove\n", dev->minor); printk("comedi%d: parport: remove\n", dev->minor);
......
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