diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-04-09 23:14:13 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-11 19:47:38 (GMT) |
commit | fa7533b01c0aa20430e6c1d561bbc4dcef7bfe56 (patch) | |
tree | 9fa863eb7da09f2a13a30e9a2f2cff1278ca3040 | |
parent | d7849efa932cc1799b51542c1b1975ff799e9fe0 (diff) | |
download | linux-fsl-qoriq-fa7533b01c0aa20430e6c1d561bbc4dcef7bfe56.tar.xz |
staging: comedi: ampcl_pc263: 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>
-rw-r--r-- | drivers/staging/comedi/drivers/amplc_pc263.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_pc263.c b/drivers/staging/comedi/drivers/amplc_pc263.c index b844943..1b1c1aa 100644 --- a/drivers/staging/comedi/drivers/amplc_pc263.c +++ b/drivers/staging/comedi/drivers/amplc_pc263.c @@ -166,20 +166,6 @@ static struct pci_dev *pc263_find_pci_dev(struct comedi_device *dev, bus, slot); return NULL; } -/* - * This function checks and requests an I/O region, reporting an error - * if there is a conflict. - */ -static int pc263_request_region(struct comedi_device *dev, unsigned long from, - unsigned long extent) -{ - if (!from || !request_region(from, extent, PC263_DRIVER_NAME)) { - dev_err(dev->class_dev, "I/O port conflict (%#lx,%lu)!\n", - from, extent); - return -EIO; - } - return 0; -} static int pc263_do_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s, @@ -268,15 +254,12 @@ static int pc263_attach(struct comedi_device *dev, struct comedi_devconfig *it) const struct pc263_board *thisboard = comedi_board(dev); int ret; - dev_info(dev->class_dev, PC263_DRIVER_NAME ": attach\n"); - /* Process options and reserve resources according to bus type. */ if (is_isa_board(thisboard)) { - unsigned long iobase = it->options[0]; - ret = pc263_request_region(dev, iobase, PC263_IO_SIZE); - if (ret < 0) + ret = comedi_request_region(dev, it->options[0], PC263_IO_SIZE); + if (ret) return ret; - return pc263_common_attach(dev, iobase); + return pc263_common_attach(dev, dev->iobase); } else if (is_pci_board(thisboard)) { struct pci_dev *pci_dev; |