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

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

staging: comedi: dt2801: 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 7d9455c5
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -593,17 +593,13 @@ static int dt2801_attach(struct comedi_device *dev, struct comedi_devconfig *it)
	const struct dt2801_board *board = comedi_board(dev);
	struct dt2801_private *devpriv;
	struct comedi_subdevice *s;
	unsigned long iobase;
	int board_code, type;
	int ret = 0;
	int n_ai_chans;

	iobase = it->options[0];
	if (!request_region(iobase, DT2801_IOSIZE, "dt2801")) {
		comedi_error(dev, "I/O port conflict");
		return -EIO;
	}
	dev->iobase = iobase;
	ret = comedi_request_region(dev, it->options[0], DT2801_IOSIZE);
	if (ret)
		return ret;

	/* do some checking */

@@ -624,10 +620,8 @@ static int dt2801_attach(struct comedi_device *dev, struct comedi_devconfig *it)
havetype:
	dev->board_ptr = boardtypes + type;
	board = comedi_board(dev);
	printk("dt2801: %s at port 0x%lx", board->name, iobase);

	n_ai_chans = probe_number_of_ai_chans(dev);
	printk(" (ai channels = %d)\n", n_ai_chans);

	ret = comedi_alloc_subdevices(dev, 4);
	if (ret)