From 5e15089202709efc23f980446702df35319882c6 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Tue, 9 Apr 2013 16:17:42 -0700 Subject: [PATCH] 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: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/dt2801.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2801.c b/drivers/staging/comedi/drivers/dt2801.c index f5a55a6ac19..b5814401a79 100644 --- a/drivers/staging/comedi/drivers/dt2801.c +++ b/drivers/staging/comedi/drivers/dt2801.c @@ -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) -- 2.46.0