staging: comedi: don't clear 'data' on (*insn_read) timeout
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 10 Feb 2014 18:49:46 +0000 (11:49 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Feb 2014 17:28:47 +0000 (09:28 -0800)
It's not necessary to clear the returned data pointer when an (*insn_read)
times out. For aesthetics, remove all of these in the drivers.

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>
drivers/staging/comedi/drivers/adl_pci9111.c
drivers/staging/comedi/drivers/adl_pci9118.c
drivers/staging/comedi/drivers/adv_pci1710.c
drivers/staging/comedi/drivers/dyna_pci10xx.c
drivers/staging/comedi/drivers/icp_multi.c
drivers/staging/comedi/drivers/pcl816.c

index 647b2d814d6187e83dae45f7543eeb15395ef700..ff086d0eedd99ad1c49d45499f1dc856c4c27a8e 100644 (file)
@@ -748,7 +748,6 @@ static int pci9111_ai_insn_read(struct comedi_device *dev,
 
                ret = comedi_timeout(dev, s, insn, pci9111_ai_eoc, 0);
                if (ret) {
-                       data[i] = 0;
                        pci9111_fifo_reset(dev);
                        return ret;
                }
index 9218e9293cf5c9f79fd84fc12a01d35e1081fc4b..6ca6c429c7228817be6c1e3f748c7cd961477c55 100644 (file)
@@ -614,7 +614,6 @@ static int pci9118_insn_read_ai(struct comedi_device *dev,
 
                ret = comedi_timeout(dev, s, insn, pci9118_ai_eoc, 0);
                if (ret) {
-                       data[n] = 0;
                        outl(0, dev->iobase + PCI9118_DELFIFO); /* flush FIFO */
                        return ret;
                }
index 16c4bb00022cfd32193e6fb8444c62aff8f5f310..5978ae63d804124bc88ed2fe1d3ec2651988223f 100644 (file)
@@ -469,7 +469,6 @@ static int pci171x_insn_read_ai(struct comedi_device *dev,
                if (ret) {
                        outb(0, dev->iobase + PCI171x_CLRFIFO);
                        outb(0, dev->iobase + PCI171x_CLRINT);
-                       data[n] = 0;
                        return ret;
                }
 
index 78d44a9c8a71b12bb36d10a4ff7637be51479de1..e5593f8c7406d3c8e693b6456b87955c4b0ae1da 100644 (file)
@@ -93,10 +93,8 @@ static int dyna_pci10xx_insn_read_ai(struct comedi_device *dev,
                udelay(10);
 
                ret = comedi_timeout(dev, s, insn, dyna_pci10xx_ai_eoc, 0);
-               if (ret) {
-                       data[n] = 0;
+               if (ret)
                        break;
-               }
 
                /* read data */
                d = inw_p(dev->iobase);
index ee30f2b8a54b6c51d1785dabdd4149f64a4a44d1..0b8b2162b76b518d3c97a613297c005021d69b48 100644 (file)
@@ -215,11 +215,8 @@ static int icp_multi_insn_read_ai(struct comedi_device *dev,
 
                /*  Wait for conversion to complete, or get fed up waiting */
                ret = comedi_timeout(dev, s, insn, icp_multi_ai_eoc, 0);
-               if (ret) {
-                       /*  Clear data received */
-                       data[n] = 0;
+               if (ret)
                        break;
-               }
 
                data[n] =
                    (readw(devpriv->io_addr + ICP_MULTI_AI) >> 4) & 0x0fff;
index 4bf2efb2c0279120997091476917d5c0979b7ee5..a35f230d1958fff4a767fd4d3ad6a7cb0fce674a 100644 (file)
@@ -196,7 +196,6 @@ static int pcl816_ai_insn_read(struct comedi_device *dev,
 
                ret = comedi_timeout(dev, s, insn, pcl816_ai_eoc, 0);
                if (ret) {
-                       data[0] = 0;
                        /* clear INT (conversion end) flag */
                        outb(0, dev->iobase + PCL816_CLRINT);
                        return ret;