Skip to content

Commit

Permalink
staging: comedi: das_08: remove the 8254 'logic2phys' usage
Browse files Browse the repository at this point in the history
The three 8254 timers have a 1:1 relationship to the comedi
channels. The 'logic2phys' usage just makes the driver more
complex.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jul 6, 2012
1 parent cba9d4a commit 6daf1e0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/staging/comedi/drivers/das08.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ static int das08_counter_read(struct comedi_device *dev,
{
struct das08_private_struct *devpriv = dev->private;
struct i8254_struct *st = &devpriv->i8254;
int chan = st->logic2phys[insn->chanspec];
int chan = insn->chanspec;

data[0] = i8254_read(st->iobase, 0, chan);
return 1;
Expand All @@ -460,7 +460,7 @@ static int das08_counter_write(struct comedi_device *dev,
{
struct das08_private_struct *devpriv = dev->private;
struct i8254_struct *st = &devpriv->i8254;
int chan = st->logic2phys[insn->chanspec];
int chan = insn->chanspec;

i8254_write(st->iobase, 0, chan, data[0]);
return 1;
Expand All @@ -472,7 +472,7 @@ static int das08_counter_config(struct comedi_device *dev,
{
struct das08_private_struct *devpriv = dev->private;
struct i8254_struct *st = &devpriv->i8254;
int chan = st->logic2phys[insn->chanspec];
int chan = insn->chanspec;

if (insn->n != 2)
return -EINVAL;
Expand Down Expand Up @@ -848,9 +848,6 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase)
s->insn_config = das08_counter_config;
/* Set-up the 8254 structure */
devpriv->i8254.channels = 3;
devpriv->i8254.logic2phys[0] = 0;
devpriv->i8254.logic2phys[1] = 1;
devpriv->i8254.logic2phys[2] = 2;
devpriv->i8254.iobase = iobase + thisboard->i8254_offset;
i8254_initialize(&devpriv->i8254);
} else {
Expand Down

0 comments on commit 6daf1e0

Please sign in to comment.