From: H Hartley Sweeten Date: Tue, 4 Mar 2014 18:29:22 +0000 (-0700) Subject: staging: comedi: pcl818: remove pcl818_check() X-Git-Tag: firefly_0821_release~176^2~4193^2~681 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=569d138fc4a08e36b48b818ea007675629eb46b5;p=firefly-linux-kernel-4.4.55.git staging: comedi: pcl818: remove pcl818_check() This function is a _very_ simplified probe that tried to verify that the driver is being attached to a PCL-818 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/pcl818.c b/drivers/staging/comedi/drivers/pcl818.c index 861f51976fd7..c9f141243c8e 100644 --- a/drivers/staging/comedi/drivers/pcl818.c +++ b/drivers/staging/comedi/drivers/pcl818.c @@ -1168,30 +1168,6 @@ static void pcl818_set_ai_range_table(struct comedi_device *dev, } } -static int pcl818_check(struct comedi_device *dev) -{ - /* the MUX register should return the same value written */ - outb(0x00, dev->iobase + PCL818_MUX); - if (inb(dev->iobase + PCL818_MUX) != 0x00) - return -ENODEV; - outb(0x55, dev->iobase + PCL818_MUX); - if (inb(dev->iobase + PCL818_MUX) != 0x55) - return -ENODEV; - - /* reset the MUX register to a known state */ - outb(0x00, dev->iobase + PCL818_MUX); - - /* the CONTROL register should return the same value written */ - outb(0x18, dev->iobase + PCL818_CONTROL); - if (inb(dev->iobase + PCL818_CONTROL) != 0x18) - return -ENODEV; - - /* reset the CONTROL register to a known state */ - outb(0x00, dev->iobase + PCL818_CONTROL); - - return 0; -} - static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it) { const struct pcl818_board *board = comedi_board(dev); @@ -1213,10 +1189,6 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it) if (ret) return ret; - ret = pcl818_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_pcl818, 0,