aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/comedi/drivers.c')
-rw-r--r--drivers/staging/comedi/drivers.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index 6456a642204..c8ebaed5c4b 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -338,13 +338,13 @@ static void comedi_report_boards(struct comedi_driver *driv)
}
/**
- * comedi_request_region() - Request an I/O reqion for a legacy driver.
+ * __comedi_request_region() - Request an I/O reqion for a legacy driver.
* @dev: comedi_device struct
* @start: base address of the I/O reqion
* @len: length of the I/O region
*/
-int comedi_request_region(struct comedi_device *dev,
- unsigned long start, unsigned long len)
+int __comedi_request_region(struct comedi_device *dev,
+ unsigned long start, unsigned long len)
{
if (!start) {
dev_warn(dev->class_dev,
@@ -358,10 +358,28 @@ int comedi_request_region(struct comedi_device *dev,
dev->board_name, start, len);
return -EIO;
}
- dev->iobase = start;
return 0;
}
+EXPORT_SYMBOL_GPL(__comedi_request_region);
+
+/**
+ * comedi_request_region() - Request an I/O reqion for a legacy driver.
+ * @dev: comedi_device struct
+ * @start: base address of the I/O reqion
+ * @len: length of the I/O region
+ */
+int comedi_request_region(struct comedi_device *dev,
+ unsigned long start, unsigned long len)
+{
+ int ret;
+
+ ret = __comedi_request_region(dev, start, len);
+ if (ret == 0)
+ dev->iobase = start;
+
+ return ret;
+}
EXPORT_SYMBOL_GPL(comedi_request_region);
int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it)