Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260016
b: refs/heads/master
c: e9d1cf8
h: refs/heads/master
v: v3
  • Loading branch information
Ravishankar authored and Greg Kroah-Hartman committed Jul 8, 2011
1 parent b2c8eaf commit 814ab7d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b041267ea819054aa9b406efc94fe8821ea2e67b
refs/heads/master: e9d1cf89ed5561adc1d36aea6d1349d12dfedd74
30 changes: 10 additions & 20 deletions trunk/drivers/staging/comedi/drivers/serial2002.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,8 @@ static int serial_2002_open(struct comedi_device *dev)
}
break;
}
if (sign) {
if (sign)
min = -min;
}
cur_config[channel].min
= min;
}
Expand Down Expand Up @@ -554,9 +553,8 @@ static int serial_2002_open(struct comedi_device *dev)
}
break;
}
if (sign) {
if (sign)
max = -max;
}
cur_config[channel].max
= max;
}
Expand Down Expand Up @@ -619,9 +617,8 @@ static int serial_2002_open(struct comedi_device *dev)
int j, chan;

for (chan = 0, j = 0; j < 32; j++) {
if (c[j].kind == kind) {
if (c[j].kind == kind)
chan++;
}
}
s = &dev->subdevices[i];
s->n_chan = chan;
Expand All @@ -646,9 +643,8 @@ static int serial_2002_open(struct comedi_device *dev)
}
for (chan = 0, j = 0; j < 32; j++) {
if (c[j].kind == kind) {
if (mapping) {
if (mapping)
mapping[chan] = j;
}
if (range) {
range[j].length = 1;
range[j].range.min =
Expand Down Expand Up @@ -701,9 +697,8 @@ static int serial_2002_open(struct comedi_device *dev)

static void serial_2002_close(struct comedi_device *dev)
{
if (!IS_ERR(devpriv->tty) && (devpriv->tty != 0)) {
if (!IS_ERR(devpriv->tty) && (devpriv->tty != 0))
filp_close(devpriv->tty, 0);
}
}

static int serial2002_di_rinsn(struct comedi_device *dev,
Expand All @@ -720,9 +715,8 @@ static int serial2002_di_rinsn(struct comedi_device *dev,
poll_digital(devpriv->tty, chan);
while (1) {
read = serial_read(devpriv->tty, 1000);
if (read.kind != is_digital || read.index == chan) {
if (read.kind != is_digital || read.index == chan)
break;
}
}
data[n] = read.value;
}
Expand Down Expand Up @@ -762,9 +756,8 @@ static int serial2002_ai_rinsn(struct comedi_device *dev,
poll_channel(devpriv->tty, chan);
while (1) {
read = serial_read(devpriv->tty, 1000);
if (read.kind != is_channel || read.index == chan) {
if (read.kind != is_channel || read.index == chan)
break;
}
}
data[n] = read.value;
}
Expand Down Expand Up @@ -798,9 +791,8 @@ static int serial2002_ao_rinsn(struct comedi_device *dev,
int n;
int chan = CR_CHAN(insn->chanspec);

for (n = 0; n < insn->n; n++) {
for (n = 0; n < insn->n; n++)
data[n] = devpriv->ao_readback[chan];
}

return n;
}
Expand All @@ -819,9 +811,8 @@ static int serial2002_ei_rinsn(struct comedi_device *dev,
poll_channel(devpriv->tty, chan);
while (1) {
read = serial_read(devpriv->tty, 1000);
if (read.kind != is_channel || read.index == chan) {
if (read.kind != is_channel || read.index == chan)
break;
}
}
data[n] = read.value;
}
Expand All @@ -835,9 +826,8 @@ static int serial2002_attach(struct comedi_device *dev,

printk("comedi%d: serial2002: ", dev->minor);
dev->board_name = thisboard->name;
if (alloc_private(dev, sizeof(struct serial2002_private)) < 0) {
if (alloc_private(dev, sizeof(struct serial2002_private)) < 0)
return -ENOMEM;
}
dev->open = serial_2002_open;
dev->close = serial_2002_close;
devpriv->port = it->options[0];
Expand Down

0 comments on commit 814ab7d

Please sign in to comment.