diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-04-09 16:23:57 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-11 12:47:51 -0700 |
commit | b8c5d2ca05e2813257e1ed38983d4b5307f8f676 (patch) | |
tree | 0bcaffd1f29f749522484ce81150192ee024c53b /drivers/staging/comedi/drivers/adq12b.c | |
parent | 54573376e8d8fa4762db6c1a35f05d4780e5145d (diff) |
staging: comedi: adq12b: 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/comedi/drivers/adq12b.c')
-rw-r--r-- | drivers/staging/comedi/drivers/adq12b.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/drivers/staging/comedi/drivers/adq12b.c b/drivers/staging/comedi/drivers/adq12b.c index dd315972d92..71ed5904382 100644 --- a/drivers/staging/comedi/drivers/adq12b.c +++ b/drivers/staging/comedi/drivers/adq12b.c @@ -213,33 +213,15 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it) { struct adq12b_private *devpriv; struct comedi_subdevice *s; - unsigned long iobase; int unipolar, differential; int ret; - iobase = it->options[0]; unipolar = it->options[1]; differential = it->options[2]; - printk(KERN_INFO "comedi%d: adq12b called with options base=0x%03lx, " - "%s and %s\n", dev->minor, iobase, - (unipolar == 1) ? "unipolar" : "bipolar", - (differential == 1) ? "differential" : "single-ended"); - - /* if no address was specified, try the default 0x300 */ - if (iobase == 0) { - printk(KERN_WARNING "comedi%d: adq12b warning: I/O base " - "address not specified. Trying the default 0x300.\n", - dev->minor); - iobase = 0x300; - } - - printk("comedi%d: adq12b: 0x%04lx ", dev->minor, iobase); - if (!request_region(iobase, ADQ12B_SIZE, "adq12b")) { - printk("I/O port conflict\n"); - return -EIO; - } - dev->iobase = iobase; + ret = comedi_request_region(dev, it->options[0], ADQ12B_SIZE); + if (ret) + return ret; devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL); if (!devpriv) @@ -300,8 +282,6 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it) s->range_table = &range_digital; s->insn_bits = adq12b_do_insn_bits; - printk(KERN_INFO "attached\n"); - return 0; } |