diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-04-09 19:10:53 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-11 15:47:37 -0400 |
commit | 22b580f07ec7cf8452496d7ad80b29ca22e1c541 (patch) | |
tree | b1fa47bc35ed08726f7e977215007d4627849155 /drivers/staging | |
parent | 92e5c90dcce34f981a625f3343a3a9baee008396 (diff) |
staging: comedi: pcl816: 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/pcl816.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/staging/comedi/drivers/pcl816.c b/drivers/staging/comedi/drivers/pcl816.c index eb0816e75d61..6266b2b02597 100644 --- a/drivers/staging/comedi/drivers/pcl816.c +++ b/drivers/staging/comedi/drivers/pcl816.c | |||
@@ -981,25 +981,16 @@ static int pcl816_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
981 | const struct pcl816_board *board = comedi_board(dev); | 981 | const struct pcl816_board *board = comedi_board(dev); |
982 | struct pcl816_private *devpriv; | 982 | struct pcl816_private *devpriv; |
983 | int ret; | 983 | int ret; |
984 | unsigned long iobase; | ||
985 | unsigned int irq, dma; | 984 | unsigned int irq, dma; |
986 | unsigned long pages; | 985 | unsigned long pages; |
987 | /* int i; */ | 986 | /* int i; */ |
988 | struct comedi_subdevice *s; | 987 | struct comedi_subdevice *s; |
989 | 988 | ||
990 | /* claim our I/O space */ | 989 | ret = comedi_request_region(dev, it->options[0], board->io_range); |
991 | iobase = it->options[0]; | 990 | if (ret) |
992 | printk("comedi%d: pcl816: board=%s, ioport=0x%03lx", dev->minor, | 991 | return ret; |
993 | board->name, iobase); | ||
994 | |||
995 | if (!request_region(iobase, board->io_range, dev->board_name)) { | ||
996 | printk("I/O port conflict\n"); | ||
997 | return -EIO; | ||
998 | } | ||
999 | |||
1000 | dev->iobase = iobase; | ||
1001 | 992 | ||
1002 | if (pcl816_check(iobase)) { | 993 | if (pcl816_check(dev->iobase)) { |
1003 | printk(KERN_ERR ", I cann't detect board. FAIL!\n"); | 994 | printk(KERN_ERR ", I cann't detect board. FAIL!\n"); |
1004 | return -EIO; | 995 | return -EIO; |
1005 | } | 996 | } |