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

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

staging: comedi: pcmuio: 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 34734c58
Loading
Loading
Loading
Loading
+4 −13
Original line number Original line Diff line number Diff line
@@ -800,25 +800,16 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
	struct pcmuio_private *devpriv;
	struct pcmuio_private *devpriv;
	struct comedi_subdevice *s;
	struct comedi_subdevice *s;
	int sdev_no, chans_left, n_subdevs, port, asic, thisasic_chanct = 0;
	int sdev_no, chans_left, n_subdevs, port, asic, thisasic_chanct = 0;
	unsigned long iobase;
	unsigned int irq[MAX_ASICS];
	unsigned int irq[MAX_ASICS];
	int ret;
	int ret;


	iobase = it->options[0];
	irq[0] = it->options[1];
	irq[0] = it->options[1];
	irq[1] = it->options[2];
	irq[1] = it->options[2];


	dev_dbg(dev->class_dev, "%s: io: %lx attach\n",
	ret = comedi_request_region(dev, it->options[0],
		dev->driver->driver_name, iobase);
				    board->num_asics * ASIC_IOSIZE);

	if (ret)
	dev->iobase = iobase;
		return ret;

	if (!iobase || !request_region(iobase,
				       board->num_asics * ASIC_IOSIZE,
				       dev->driver->driver_name)) {
		dev_err(dev->class_dev, "I/O port conflict\n");
		return -EIO;
	}


	devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
	devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
	if (!devpriv)
	if (!devpriv)