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

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

staging: comedi: pcmmio: 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 7b650090
Loading
Loading
Loading
Loading
+3 −13
Original line number Original line Diff line number Diff line
@@ -1034,22 +1034,14 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
	struct comedi_subdevice *s;
	struct comedi_subdevice *s;
	int sdev_no, chans_left, n_dio_subdevs, n_subdevs, port, asic,
	int sdev_no, chans_left, n_dio_subdevs, n_subdevs, port, asic,
	    thisasic_chanct = 0;
	    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];


	printk(KERN_INFO "comedi%d: %s: io: %lx attaching...\n", dev->minor,
	ret = comedi_request_region(dev, it->options[0], 32);
			dev->board_name, iobase);
	if (ret)

		return ret;
	dev->iobase = iobase;

	if (!iobase || !request_region(iobase, 32, dev->board_name)) {
		printk(KERN_ERR "comedi%d: I/O port conflict\n", dev->minor);
		return -EIO;
	}


	devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
	devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
	if (!devpriv)
	if (!devpriv)
@@ -1206,8 +1198,6 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
				 * multiple irqs..
				 * multiple irqs..
				 */
				 */


	printk(KERN_INFO "comedi%d: attached\n", dev->minor);

	return 1;
	return 1;
}
}