mirror of https://gitee.com/openkylin/linux.git
staging: comedi: comedi_parport: 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
2e5fc06aa7
commit
8bee2dead8
|
@ -261,17 +261,13 @@ static int parport_attach(struct comedi_device *dev,
|
|||
struct comedi_devconfig *it)
|
||||
{
|
||||
struct parport_private *devpriv;
|
||||
int ret;
|
||||
unsigned int irq;
|
||||
unsigned long iobase;
|
||||
struct comedi_subdevice *s;
|
||||
unsigned int irq;
|
||||
int ret;
|
||||
|
||||
iobase = it->options[0];
|
||||
if (!request_region(iobase, PARPORT_SIZE, dev->board_name)) {
|
||||
dev_err(dev->class_dev, "I/O port conflict\n");
|
||||
return -EIO;
|
||||
}
|
||||
dev->iobase = iobase;
|
||||
ret = comedi_request_region(dev, it->options[0], PARPORT_SIZE);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
irq = it->options[1];
|
||||
if (irq) {
|
||||
|
@ -339,9 +335,6 @@ static int parport_attach(struct comedi_device *dev,
|
|||
devpriv->c_data = 0;
|
||||
outb(devpriv->c_data, dev->iobase + PARPORT_C);
|
||||
|
||||
dev_info(dev->class_dev, "%s: iobase=0x%04lx, irq %sabled",
|
||||
dev->board_name, dev->iobase, dev->irq ? "en" : "dis");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue