diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-04-09 19:08:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-11 15:47:35 -0400 |
commit | 9526728e0a8516b79f3c62c3a7583269f5195ccb (patch) | |
tree | 1469c34fd7fa391307e76db6d21b7612eac59e17 /drivers/staging | |
parent | 15ab88b6cad83076c1ee7ad411956ae9b9c2fd1e (diff) |
staging: comedi: pcl725: 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.
Also, remove the unnecessary 'dev->irq = 0'. This driver does not
use interrupts and the comedi core has already cleared this variable.
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/pcl725.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/staging/comedi/drivers/pcl725.c b/drivers/staging/comedi/drivers/pcl725.c index 3cd5e7f04f42..5a2bc6733f60 100644 --- a/drivers/staging/comedi/drivers/pcl725.c +++ b/drivers/staging/comedi/drivers/pcl725.c | |||
@@ -45,17 +45,11 @@ static int pcl725_di_insn(struct comedi_device *dev, struct comedi_subdevice *s, | |||
45 | static int pcl725_attach(struct comedi_device *dev, struct comedi_devconfig *it) | 45 | static int pcl725_attach(struct comedi_device *dev, struct comedi_devconfig *it) |
46 | { | 46 | { |
47 | struct comedi_subdevice *s; | 47 | struct comedi_subdevice *s; |
48 | unsigned long iobase; | ||
49 | int ret; | 48 | int ret; |
50 | 49 | ||
51 | iobase = it->options[0]; | 50 | ret = comedi_request_region(dev, it->options[0], PCL725_SIZE); |
52 | printk(KERN_INFO "comedi%d: pcl725: 0x%04lx ", dev->minor, iobase); | 51 | if (ret) |
53 | if (!request_region(iobase, PCL725_SIZE, "pcl725")) { | 52 | return ret; |
54 | printk("I/O port conflict\n"); | ||
55 | return -EIO; | ||
56 | } | ||
57 | dev->iobase = iobase; | ||
58 | dev->irq = 0; | ||
59 | 53 | ||
60 | ret = comedi_alloc_subdevices(dev, 2); | 54 | ret = comedi_alloc_subdevices(dev, 2); |
61 | if (ret) | 55 | if (ret) |