From 5b365a8ace90bd027a34f0db4c1c28f2ba433910 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Tue, 9 Apr 2013 16:34:36 -0700 Subject: [PATCH] staging: comedi: ni_labpc: use comedi_request_region() Use comedi_request_region() to request the I/O region used by this driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_labpc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c index 8083f4815693..19961424d1df 100644 --- a/drivers/staging/comedi/drivers/ni_labpc.c +++ b/drivers/staging/comedi/drivers/ni_labpc.c @@ -1758,9 +1758,9 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it) { const struct labpc_boardinfo *board = comedi_board(dev); struct labpc_private *devpriv; - unsigned long iobase = 0; unsigned int irq = 0; unsigned int dma_chan = 0; + int ret; devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL); if (!devpriv) @@ -1771,12 +1771,11 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it) switch (board->bustype) { case isa_bustype: #ifdef CONFIG_ISA_DMA_API - iobase = it->options[0]; irq = it->options[1]; dma_chan = it->options[2]; - if (!request_region(iobase, LABPC_SIZE, dev->board_name)) - return -EIO; - dev->iobase = iobase; + ret = comedi_request_region(dev, it->options[0], LABPC_SIZE); + if (ret) + return ret; #else dev_err(dev->class_dev, "ni_labpc driver has not been built with ISA DMA support.\n"); -- 2.39.5