staging: comedi: pcl3724: 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>
This commit is contained in:
parent
d6c5ec047e
commit
011c131f58
1 changed files with 3 additions and 14 deletions
|
@ -226,27 +226,16 @@ static int pcm3724_attach(struct comedi_device *dev,
|
||||||
{
|
{
|
||||||
struct priv_pcm3724 *priv;
|
struct priv_pcm3724 *priv;
|
||||||
struct comedi_subdevice *s;
|
struct comedi_subdevice *s;
|
||||||
unsigned long iobase;
|
|
||||||
unsigned int iorange;
|
|
||||||
int ret, i;
|
int ret, i;
|
||||||
|
|
||||||
iobase = it->options[0];
|
|
||||||
iorange = PCM3724_SIZE;
|
|
||||||
|
|
||||||
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
|
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
|
||||||
if (!priv)
|
if (!priv)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
dev->private = priv;
|
dev->private = priv;
|
||||||
|
|
||||||
printk(KERN_INFO "comedi%d: pcm3724: board=%s, 0x%03lx ", dev->minor,
|
ret = comedi_request_region(dev, it->options[0], PCM3724_SIZE);
|
||||||
dev->board_name, iobase);
|
if (ret)
|
||||||
if (!iobase || !request_region(iobase, iorange, "pcm3724")) {
|
return ret;
|
||||||
printk("I/O port conflict\n");
|
|
||||||
return -EIO;
|
|
||||||
}
|
|
||||||
|
|
||||||
dev->iobase = iobase;
|
|
||||||
printk(KERN_INFO "\n");
|
|
||||||
|
|
||||||
ret = comedi_alloc_subdevices(dev, 2);
|
ret = comedi_alloc_subdevices(dev, 2);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue