Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364020
b: refs/heads/master
c: f375ac5
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Apr 11, 2013
1 parent 3bc6481 commit 8c0a836
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aa7a82b9f941f1e299bf9b26dcd8bb76ecce3c8f
refs/heads/master: f375ac5f197d32aeffe5436e5864525cc14ce44a
3 changes: 3 additions & 0 deletions trunk/drivers/staging/comedi/comedidev.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ void comedi_buf_memcpy_from(struct comedi_async *async, unsigned int offset,

int comedi_alloc_subdevices(struct comedi_device *, int);

int comedi_request_region(struct comedi_device *,
unsigned long start, unsigned long len);

int comedi_auto_config(struct device *, struct comedi_driver *,
unsigned long context);
void comedi_auto_unconfig(struct device *);
Expand Down
27 changes: 27 additions & 0 deletions trunk/drivers/staging/comedi/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,33 @@ static void comedi_report_boards(struct comedi_driver *driv)
pr_info(" %s\n", driv->driver_name);
}

/**
* 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)
{
if (!start) {
dev_warn(dev->class_dev,
"%s: a I/O base address must be specified\n",
dev->board_name);
return -EINVAL;
}

if (!request_region(start, len, dev->board_name)) {
dev_warn(dev->class_dev, "%s: I/O port conflict (%#lx,%lu)\n",
dev->board_name, start, len);
return -EIO;
}
dev->iobase = start;

return 0;
}
EXPORT_SYMBOL_GPL(comedi_request_region);

int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
struct comedi_driver *driv;
Expand Down

0 comments on commit 8c0a836

Please sign in to comment.