[PATCH 69/79] staging: comedi: das1800: use __comedi_request_region()

Greg Kroah-Hartman gregkh at linuxfoundation.org
Wed Apr 10 16:35:07 UTC 2013


On Wed, Apr 10, 2013 at 11:09:55AM -0500, H Hartley Sweeten wrote:
> On Wednesday, April 10, 2013 6:25 AM, Dan Carpenter wrote:
> > On Tue, Apr 09, 2013 at 04:31:26PM -0700, H Hartley Sweeten wrote:
> >> Use __comedi_request_region() to request the additional I/O region
> >> used by this driver.
> >> 
> >> Remove the error message when the request_region() fails,
> >> comedi_request_reqion() will output the error message if necessary.
> >> 
> >> For aesthetic reasons, rename the local variable 'retval' to
> >> simply 'ret'.
> >> 
> >> Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
> >> Cc: Ian Abbott <abbotti at mev.co.uk>
> >> Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
> >> ---
> >>  drivers/staging/comedi/drivers/das1800.c | 31 ++++++++++++++-----------------
> >>  1 file changed, 14 insertions(+), 17 deletions(-)
> >> 
> >> diff --git a/drivers/staging/comedi/drivers/das1800.c b/drivers/staging/comedi/drivers/das1800.c
> >> index cf265c1..0427bf0 100644
> >> --- a/drivers/staging/comedi/drivers/das1800.c
> >> +++ b/drivers/staging/comedi/drivers/das1800.c
> >> @@ -1514,18 +1514,17 @@ static int das1800_attach(struct comedi_device *dev,
> >>  	unsigned int irq = it->options[1];
> >>  	unsigned int dma0 = it->options[2];
> >>  	unsigned int dma1 = it->options[3];
> >> -	unsigned long iobase2;
> >>  	int board;
> >> -	int retval;
> >> +	int ret;
> >>  
> >>  	devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
> >>  	if (!devpriv)
> >>  		return -ENOMEM;
> >>  	dev->private = devpriv;
> >>  
> >> -	retval = comedi_request_region(dev, it->options[0], DAS1800_SIZE);
> >> -	if (retval)
> >> -		return retval;
> >> +	ret = comedi_request_region(dev, it->options[0], DAS1800_SIZE);
> >> +	if (ret)
> >> +		return ret;
> >>  
> >>  	board = das1800_probe(dev);
> >>  	if (board < 0) {
> >> @@ -1539,13 +1538,11 @@ static int das1800_attach(struct comedi_device *dev,
> >>  
> >>  	/*  if it is an 'ao' board with fancy analog out then we need extra io ports */
> >>  	if (thisboard->ao_ability == 2) {
> >> -		iobase2 = dev->iobase + IOBASE2;
> >> -		if (!request_region(iobase2, DAS1800_SIZE, dev->board_name)) {
> >> +		unsigned long iobase2 = dev->iobase + IOBASE2;
> >> +
> >> +		ret = comedi_request_region(dev, iobase2, DAS1800_SIZE);
> >
> > Was the intent to use the underscored version here?
> 
> Ugh. Fat-fingered that one.
> 
> Is a v2 of just this patch ok or should I repost the entire series?

Just send a v2.




More information about the devel mailing list