staging: comedi: pcmuio: use comedi_request_region()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 9 Apr 2013 23:28:06 +0000 (16:28 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Apr 2013 19:47:52 +0000 (12:47 -0700)
Use comedi_request_region() to request the I/O region used by this
driver.

Remove the noise when the board is first attached as well as the
error message when the request_region() fails, comedi_request_reqion()
will output the error message if necessary.

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

index 745f7b908767f488155058bdc8c6b924d1245baf..fc15d48bd30eea826453a208cfe8d0184e18692c 100644 (file)
@@ -800,25 +800,16 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        struct pcmuio_private *devpriv;
        struct comedi_subdevice *s;
        int sdev_no, chans_left, n_subdevs, port, asic, thisasic_chanct = 0;
-       unsigned long iobase;
        unsigned int irq[MAX_ASICS];
        int ret;
 
-       iobase = it->options[0];
        irq[0] = it->options[1];
        irq[1] = it->options[2];
 
-       dev_dbg(dev->class_dev, "%s: io: %lx attach\n",
-               dev->driver->driver_name, iobase);
-
-       dev->iobase = iobase;
-
-       if (!iobase || !request_region(iobase,
-                                      board->num_asics * ASIC_IOSIZE,
-                                      dev->driver->driver_name)) {
-               dev_err(dev->class_dev, "I/O port conflict\n");
-               return -EIO;
-       }
+       ret = comedi_request_region(dev, it->options[0],
+                                   board->num_asics * ASIC_IOSIZE);
+       if (ret)
+               return ret;
 
        devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
        if (!devpriv)