From 9f7256295e92c80a27679c1b29e72af68f82f8ec Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Fri, 30 Mar 2001 20:31:59 +0000 Subject: [PATCH] fixed previous over-eager to change things that dont need to change patch, real problem was just one line --- comedi/drivers.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/comedi/drivers.c b/comedi/drivers.c index aa82e91b..2d03e41b 100644 --- a/comedi/drivers.c +++ b/comedi/drivers.c @@ -468,10 +468,6 @@ static int insn_emulate_bits(comedi_device *dev,comedi_subdevice *s, return -EINVAL; new_data[0] = 1<insn == INSN_READ){ - if(!(s->subdev_flags & SDF_READABLE)) - return -EINVAL; - data[0] = (new_data[1]>>chan)&1; }else { new_data[0] = 0; new_data[1] = 0; @@ -480,6 +476,12 @@ static int insn_emulate_bits(comedi_device *dev,comedi_subdevice *s, ret = s->insn_bits(dev,s,&new_insn,new_data); if(ret<0)return ret; + if(insn->insn == INSN_READ){ + if(!(s->subdev_flags & SDF_READABLE)) + return -EINVAL; + data[0] = (new_data[1]>>chan)&1; + } + return 1; } -- 2.26.2