aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-04-09 19:11:31 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-11 15:47:37 -0400
commitd6c5ec047e6a4d50942dba9298ec5c239ee2a2bf (patch)
tree94754807820f4624c9c12296cbea93f6ddc03d8b /drivers/staging
parentb27cc4135cd54064ccee8b4aeccfc659e19447a6 (diff)
staging: comedi: pcl818: use comedi_request_region()
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>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/comedi/drivers/pcl818.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/staging/comedi/drivers/pcl818.c b/drivers/staging/comedi/drivers/pcl818.c
index e4df63e2e3f9..6540186753ee 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -1594,7 +1594,6 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
1594 const struct pcl818_board *board = comedi_board(dev); 1594 const struct pcl818_board *board = comedi_board(dev);
1595 struct pcl818_private *devpriv; 1595 struct pcl818_private *devpriv;
1596 int ret; 1596 int ret;
1597 unsigned long iobase;
1598 unsigned int irq; 1597 unsigned int irq;
1599 int dma; 1598 int dma;
1600 unsigned long pages; 1599 unsigned long pages;
@@ -1605,25 +1604,17 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
1605 return -ENOMEM; 1604 return -ENOMEM;
1606 dev->private = devpriv; 1605 dev->private = devpriv;
1607 1606
1608 /* claim our I/O space */
1609 iobase = it->options[0];
1610 printk
1611 ("comedi%d: pcl818: board=%s, ioport=0x%03lx",
1612 dev->minor, board->name, iobase);
1613 devpriv->io_range = board->io_range; 1607 devpriv->io_range = board->io_range;
1614 if ((board->fifo) && (it->options[2] == -1)) { 1608 if ((board->fifo) && (it->options[2] == -1)) {
1615 /* we've board with FIFO and we want to use FIFO */ 1609 /* we've board with FIFO and we want to use FIFO */
1616 devpriv->io_range = PCLx1xFIFO_RANGE; 1610 devpriv->io_range = PCLx1xFIFO_RANGE;
1617 devpriv->usefifo = 1; 1611 devpriv->usefifo = 1;
1618 } 1612 }
1619 if (!request_region(iobase, devpriv->io_range, dev->board_name)) { 1613 ret = comedi_request_region(dev, it->options[0], devpriv->io_range);
1620 comedi_error(dev, "I/O port conflict\n"); 1614 if (ret)
1621 return -EIO; 1615 return ret;
1622 }
1623
1624 dev->iobase = iobase;
1625 1616
1626 if (pcl818_check(iobase)) { 1617 if (pcl818_check(dev->iobase)) {
1627 comedi_error(dev, "I can't detect board. FAIL!\n"); 1618 comedi_error(dev, "I can't detect board. FAIL!\n");
1628 return -EIO; 1619 return -EIO;
1629 } 1620 }