From: H Hartley Sweeten Date: Tue, 9 Apr 2013 23:32:24 +0000 (-0700) Subject: staging: comedi: comedi_parport: use comedi_request_region() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8bee2dead8326f4144eab10126448fb58b4b2ac3;p=linux-beck.git 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: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/comedi_parport.c b/drivers/staging/comedi/drivers/comedi_parport.c index e392f6837ab1..f9dc1e8a8dad 100644 --- a/drivers/staging/comedi/drivers/comedi_parport.c +++ b/drivers/staging/comedi/drivers/comedi_parport.c @@ -261,17 +261,13 @@ static int parport_attach(struct comedi_device *dev, struct comedi_devconfig *it) { struct parport_private *devpriv; - int ret; - unsigned int irq; - unsigned long iobase; struct comedi_subdevice *s; + unsigned int irq; + int ret; - iobase = it->options[0]; - if (!request_region(iobase, PARPORT_SIZE, dev->board_name)) { - dev_err(dev->class_dev, "I/O port conflict\n"); - return -EIO; - } - dev->iobase = iobase; + ret = comedi_request_region(dev, it->options[0], PARPORT_SIZE); + if (ret) + return ret; irq = it->options[1]; if (irq) { @@ -339,9 +335,6 @@ static int parport_attach(struct comedi_device *dev, devpriv->c_data = 0; 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; }