]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
staging: comedi: pcl816: remove pcl816_check()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 4 Mar 2014 18:29:21 +0000 (11:29 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2014 01:06:09 +0000 (17:06 -0800)
This function is a _very_ simplified probe that tried to verify that
the driver is being attached to a PCL-816 compatible board. The function
simply writes some values to specific registers then reads back the
values to see if they are the same.

It's possible that the user could try to attach this driver to a non-
compatible board but the check would still pass depending on the register
map of the board.

Just remove the buggy function to simplify the attach a bit.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/pcl816.c

index 2e383ebde11999ac66def832f93aa5594ebba9d5..c0ad0f12ee7a5b847b8a76f3c7c8fbe794bf6dbb 100644 (file)
@@ -714,30 +714,6 @@ setup_channel_list(struct comedi_device *dev,
             dev->iobase + PCL816_MUX);
 }
 
-static int pcl816_check(struct comedi_device *dev)
-{
-       /* the MUX register should return the same value written */
-       outb(0x00, dev->iobase + PCL816_MUX);
-       if (inb(dev->iobase + PCL816_MUX) != 0x00)
-               return -ENODEV;
-       outb(0x55, dev->iobase + PCL816_MUX);
-       if (inb(dev->iobase + PCL816_MUX) != 0x55)
-               return -ENODEV;
-
-       /* reset the MUX register to a known state */
-       outb(0x00, dev->iobase + PCL816_MUX);
-
-       /* the CONTROL register should return the same value written */
-       outb(0x18, dev->iobase + PCL816_CONTROL);
-       if (inb(dev->iobase + PCL816_CONTROL) != 0x18)
-               return -ENODEV;
-
-       /* reset the CONTROL register to a known state */
-       outb(0x00, dev->iobase + PCL816_CONTROL);
-
-       return 0;
-}
-
 static int pcl816_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
        const struct pcl816_board *board = comedi_board(dev);
@@ -754,10 +730,6 @@ static int pcl816_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       ret = pcl816_check(dev);
-       if (ret)
-               return ret;
-
        /* we can use IRQ 2-7 for async command support */
        if (it->options[1] >= 2 && it->options[1] <= 7) {
                ret = request_irq(it->options[1], interrupt_pcl816, 0,