Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8bee2dea authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2e5fc06a
Loading
Loading
Loading
Loading
+5 −12
Original line number Original line Diff line number Diff line
@@ -261,17 +261,13 @@ static int parport_attach(struct comedi_device *dev,
			  struct comedi_devconfig *it)
			  struct comedi_devconfig *it)
{
{
	struct parport_private *devpriv;
	struct parport_private *devpriv;
	int ret;
	unsigned int irq;
	unsigned long iobase;
	struct comedi_subdevice *s;
	struct comedi_subdevice *s;
	unsigned int irq;
	int ret;


	iobase = it->options[0];
	ret = comedi_request_region(dev, it->options[0], PARPORT_SIZE);
	if (!request_region(iobase, PARPORT_SIZE, dev->board_name)) {
	if (ret)
		dev_err(dev->class_dev, "I/O port conflict\n");
		return ret;
		return -EIO;
	}
	dev->iobase = iobase;


	irq = it->options[1];
	irq = it->options[1];
	if (irq) {
	if (irq) {
@@ -339,9 +335,6 @@ static int parport_attach(struct comedi_device *dev,
	devpriv->c_data = 0;
	devpriv->c_data = 0;
	outb(devpriv->c_data, dev->iobase + PARPORT_C);
	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;
	return 0;
}
}